From 534cc4bb512ee674e57828e73ddb72dbe551d097 Mon Sep 17 00:00:00 2001 From: Raj Nishtala Date: Tue, 20 Aug 2024 14:06:07 -0400 Subject: [PATCH] Remove labels not relevant to the test --- tests/integration/features.go | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/tests/integration/features.go b/tests/integration/features.go index 3196a082cb..27e40cd34c 100644 --- a/tests/integration/features.go +++ b/tests/integration/features.go @@ -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) @@ -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) }, ). @@ -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 @@ -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)