Skip to content

Commit

Permalink
Remove labels not relevant to the test
Browse files Browse the repository at this point in the history
  • Loading branch information
rnishtala-sumo committed Aug 20, 2024
1 parent 12584bd commit 534cc4b
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions tests/integration/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ func GetMetricsFeature(expectedMetrics []string, metricsCollector MetricsCollect
"pod": podList.Items[0].Name,
"replicaset": fmt.Sprintf("%s-.*", deployment),
"service": deployment,
"service.address": ".*",
"service.port": ".*",
"url.scheme": ".*",
}
expectedLabels = addCollectorSpecificMetricLabels(expectedLabels, releaseName, namespace, metricsCollector)

Expand All @@ -124,17 +127,19 @@ func GetMetricsFeature(expectedMetrics []string, metricsCollector MetricsCollect
}
namespace := ctxopts.Namespace(ctx)
expectedLabels := sumologicmock.Labels{
"cluster": "kubernetes",
"_origin": "kubernetes",
"deployment": deployment,
"endpoint": "http",
"job": "kube-state-metrics",
"namespace": ctxopts.Namespace(ctx),
"cluster": "kubernetes",
"_origin": "kubernetes",
"deployment": deployment,
"endpoint": "http",
"job": "kube-state-metrics",
"namespace": ctxopts.Namespace(ctx),
"service.address": ".*",
"service.port": ".*",
"url.scheme": ".*",
}
expectedLabels = addCollectorSpecificMetricLabels(expectedLabels, releaseName, namespace, metricsCollector)
// drop some unnecessary labels
delete(expectedLabels, "prometheus_service")

return stepfuncs.WaitUntilExpectedMetricLabelsPresent(metricFilters, expectedLabels, waitDuration, tickDuration)(ctx, t, envConf)
},
).
Expand Down Expand Up @@ -172,6 +177,9 @@ func GetMetricsFeature(expectedMetrics []string, metricsCollector MetricsCollect
"service": deployment,
"service_discovery_pod": fmt.Sprintf("%s-.+", deployment),
"uid": ".+",
"service.address": ".*",
"service.port": ".*",
"url.scheme": ".*",
}
expectedLabels = addCollectorSpecificMetricLabels(expectedLabels, releaseName, namespace, metricsCollector)
// drop some unnecessary labels
Expand Down Expand Up @@ -218,6 +226,9 @@ func GetTelegrafMetricsFeature(expectedMetrics []string, metricsCollector Metric
"port": "80",
"server": "localhost",
"pod_template_hash": ".+",
"service.address": ".*",
"service.port": ".*",
"url.scheme": ".*",
}
expectedLabels = addCollectorSpecificMetricLabels(expectedLabels, releaseName, namespace, metricsCollector)

Expand Down

0 comments on commit 534cc4b

Please sign in to comment.