Skip to content

Commit

Permalink
unit test object name change
Browse files Browse the repository at this point in the history
Signed-off-by: adarsh0728 <[email protected]>
  • Loading branch information
adarsh0728 committed Feb 3, 2025
1 parent a56214e commit c8755b6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/advanced-install/namespaced-numaflow-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ data:
config.yaml: "# url is a required field, it should be the url of the service to
which the metrics proxy will connect\n# url: service_name + \".\" + service_namespace
+ \".svc.cluster.local\" + \":\" + port\n# example for local prometheus service\n#
url: http://prometheus-operated.monitoring.svc.cluster.local:9090 \npatterns:\n-
url: http://prometheus-operated.monitoring.svc.cluster.local:9090\npatterns:\n-
name: vertex_gauge\n objects: \n - vertex\n title: Vertex Pending Messages\n
\ description: This query is the total number of pending messages for the vertex\n
\ expr: |\n sum($metric_name{$filters}) by ($dimension, period)\n params:\n
Expand Down
2 changes: 1 addition & 1 deletion config/advanced-install/numaflow-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ data:
config.yaml: "# url is a required field, it should be the url of the service to
which the metrics proxy will connect\n# url: service_name + \".\" + service_namespace
+ \".svc.cluster.local\" + \":\" + port\n# example for local prometheus service\n#
url: http://prometheus-operated.monitoring.svc.cluster.local:9090 \npatterns:\n-
url: http://prometheus-operated.monitoring.svc.cluster.local:9090\npatterns:\n-
name: vertex_gauge\n objects: \n - vertex\n title: Vertex Pending Messages\n
\ description: This query is the total number of pending messages for the vertex\n
\ expr: |\n sum($metric_name{$filters}) by ($dimension, period)\n params:\n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
# url is a required field, it should be the url of the service to which the metrics proxy will connect
# url: service_name + "." + service_namespace + ".svc.cluster.local" + ":" + port
# example for local prometheus service
# url: http://prometheus-operated.monitoring.svc.cluster.local:9090
# url: http://prometheus-operated.monitoring.svc.cluster.local:9090
patterns:
- name: vertex_gauge
objects:
Expand Down
2 changes: 1 addition & 1 deletion config/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28875,7 +28875,7 @@ data:
config.yaml: "# url is a required field, it should be the url of the service to
which the metrics proxy will connect\n# url: service_name + \".\" + service_namespace
+ \".svc.cluster.local\" + \":\" + port\n# example for local prometheus service\n#
url: http://prometheus-operated.monitoring.svc.cluster.local:9090 \npatterns:\n-
url: http://prometheus-operated.monitoring.svc.cluster.local:9090\npatterns:\n-
name: vertex_gauge\n objects: \n - vertex\n title: Vertex Pending Messages\n
\ description: This query is the total number of pending messages for the vertex\n
\ expr: |\n sum($metric_name{$filters}) by ($dimension, period)\n params:\n
Expand Down
2 changes: 1 addition & 1 deletion config/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28763,7 +28763,7 @@ data:
config.yaml: "# url is a required field, it should be the url of the service to
which the metrics proxy will connect\n# url: service_name + \".\" + service_namespace
+ \".svc.cluster.local\" + \":\" + port\n# example for local prometheus service\n#
url: http://prometheus-operated.monitoring.svc.cluster.local:9090 \npatterns:\n-
url: http://prometheus-operated.monitoring.svc.cluster.local:9090\npatterns:\n-
name: vertex_gauge\n objects: \n - vertex\n title: Vertex Pending Messages\n
\ description: This query is the total number of pending messages for the vertex\n
\ expr: |\n sum($metric_name{$filters}) by ($dimension, period)\n params:\n
Expand Down
11 changes: 5 additions & 6 deletions server/apis/v1/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ func TestHandler_DiscoverMetrics(t *testing.T) {
}{
{
name: "empty patterns",
object: "pipeline",
object: "vertex",
configPatterns: []Pattern{},
want: MetricsDiscoveryResponse{},
},
{
name: "no matching object",
object: "pipeline",
object: "pipeline", // case where request has a different object than pattern's list of objects
configPatterns: []Pattern{
{
Objects: []string{"vertex"},
Expand All @@ -174,10 +174,10 @@ func TestHandler_DiscoverMetrics(t *testing.T) {
},
{
name: "single metric with required filters",
object: "pipeline",
object: "vertex",
configPatterns: []Pattern{
{
Objects: []string{"pipeline"},
Objects: []string{"vertex"},
Params: []Params{
{
Name: "quantile",
Expand All @@ -187,7 +187,7 @@ func TestHandler_DiscoverMetrics(t *testing.T) {
Metrics: []Metric{
{
Name: "processing_rate",
Filters: []string{"namespace", "pipeline"},
Filters: []string{"namespace"},
Dimensions: []Dimension{
{
Name: "vertex",
Expand All @@ -208,7 +208,6 @@ func TestHandler_DiscoverMetrics(t *testing.T) {
Name: "vertex",
Filters: []Filter{
{Name: "namespace", Required: true},
{Name: "pipeline", Required: true},
{Name: "vertex", Required: true},
},
Params: []Params{{
Expand Down

0 comments on commit c8755b6

Please sign in to comment.