Skip to content

Commit eec1ae5

Browse files
authored
[chore] disable testPrometheusAnnotationMetrics for v0.128.0 (#1890)
Signed-off-by: Dani Louca <dlouca@splunk.com>
1 parent 617a9f9 commit eec1ae5

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

functional_tests/functional/functional_test.go

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ func Test_Functions(t *testing.T) {
536536
t.Run("test HEC metrics", testHECMetrics)
537537
t.Run("test k8s objects", testK8sObjects)
538538
t.Run("test agent metrics", testAgentMetrics)
539-
t.Run("test prometheus metrics", testPrometheusAnnotationMetrics)
539+
// TODO: re-enable this test in 0.129.0 https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/40788
540+
// t.Run("test prometheus metrics", testPrometheusAnnotationMetrics)
540541
}
541542

542543
func testNodeJSTraces(t *testing.T) {
@@ -1242,41 +1243,41 @@ func testAgentMetrics(t *testing.T) {
12421243
assert.NoError(t, err)
12431244
}
12441245

1245-
func testPrometheusAnnotationMetrics(t *testing.T) {
1246-
agentMetricsConsumer := globalSinks.agentMetricsConsumer
1247-
1248-
metricNames := []string{
1249-
"istio_agent_cert_expiry_seconds",
1250-
"istio_agent_endpoint_no_pod",
1251-
"istio_agent_go_gc_cycles_automatic_gc_cycles_total",
1252-
"istio_agent_go_gc_cycles_forced_gc_cycles_total",
1253-
"istio_agent_go_gc_cycles_total_gc_cycles_total",
1254-
"istio_agent_go_gc_duration_seconds_sum",
1255-
"istio_agent_go_gc_duration_seconds_count",
1256-
"istio_agent_go_gc_heap_allocs_by_size_bytes_total_bucket",
1257-
"istio_agent_go_gc_heap_allocs_by_size_bytes_total_sum",
1258-
"istio_agent_go_gc_heap_allocs_by_size_bytes_total_count",
1259-
}
1260-
// when scraping via prometheus.io/scrape annotation, no additional attributes are present.
1261-
checkMetricsAreEmitted(t, agentMetricsConsumer, metricNames, func(attrs pcommon.Map) bool {
1262-
_, podLabelPresent := attrs.Get("pod")
1263-
_, serviceLabelPresent := attrs.Get("service")
1264-
return !podLabelPresent && !serviceLabelPresent
1265-
})
1266-
// when scraping via pod monitor, the pod attribute refers to the pod the metric is scraped from.
1267-
checkMetricsAreEmitted(t, agentMetricsConsumer, metricNames, func(attrs pcommon.Map) bool {
1268-
_, podLabelPresent := attrs.Get("pod")
1269-
_, serviceLabelPresent := attrs.Get("service")
1270-
return podLabelPresent && !serviceLabelPresent
1271-
})
1272-
// when scraping via service monitor, the pod attribute refers to the pod the metric is scraped from,
1273-
// and the servicelabel attribute is added by the serviceMonitor definition.
1274-
checkMetricsAreEmitted(t, agentMetricsConsumer, metricNames, func(attrs pcommon.Map) bool {
1275-
_, podLabelPresent := attrs.Get("pod")
1276-
_, serviceLabelPresent := attrs.Get("service")
1277-
return podLabelPresent && serviceLabelPresent
1278-
})
1279-
}
1246+
// func testPrometheusAnnotationMetrics(t *testing.T) {
1247+
// agentMetricsConsumer := globalSinks.agentMetricsConsumer
1248+
//
1249+
// metricNames := []string{
1250+
// "istio_agent_cert_expiry_seconds",
1251+
// "istio_agent_endpoint_no_pod",
1252+
// "istio_agent_go_gc_cycles_automatic_gc_cycles_total",
1253+
// "istio_agent_go_gc_cycles_forced_gc_cycles_total",
1254+
// "istio_agent_go_gc_cycles_total_gc_cycles_total",
1255+
// "istio_agent_go_gc_duration_seconds_sum",
1256+
// "istio_agent_go_gc_duration_seconds_count",
1257+
// "istio_agent_go_gc_heap_allocs_by_size_bytes_total_bucket",
1258+
// "istio_agent_go_gc_heap_allocs_by_size_bytes_total_sum",
1259+
// "istio_agent_go_gc_heap_allocs_by_size_bytes_total_count",
1260+
// }
1261+
// // when scraping via prometheus.io/scrape annotation, no additional attributes are present.
1262+
// checkMetricsAreEmitted(t, agentMetricsConsumer, metricNames, func(attrs pcommon.Map) bool {
1263+
// _, podLabelPresent := attrs.Get("pod")
1264+
// _, serviceLabelPresent := attrs.Get("service")
1265+
// return !podLabelPresent && !serviceLabelPresent
1266+
// })
1267+
// // when scraping via pod monitor, the pod attribute refers to the pod the metric is scraped from.
1268+
// checkMetricsAreEmitted(t, agentMetricsConsumer, metricNames, func(attrs pcommon.Map) bool {
1269+
// _, podLabelPresent := attrs.Get("pod")
1270+
// _, serviceLabelPresent := attrs.Get("service")
1271+
// return podLabelPresent && !serviceLabelPresent
1272+
// })
1273+
// // when scraping via service monitor, the pod attribute refers to the pod the metric is scraped from,
1274+
// // and the servicelabel attribute is added by the serviceMonitor definition.
1275+
// checkMetricsAreEmitted(t, agentMetricsConsumer, metricNames, func(attrs pcommon.Map) bool {
1276+
// _, podLabelPresent := attrs.Get("pod")
1277+
// _, serviceLabelPresent := attrs.Get("service")
1278+
// return podLabelPresent && serviceLabelPresent
1279+
// })
1280+
//}
12801281

12811282
func selectMetricSet(expected pmetric.Metrics, metricName string, metricSink *consumertest.MetricsSink, ignoreLen bool) *pmetric.Metrics {
12821283
for h := len(metricSink.AllMetrics()) - 1; h >= 0; h-- {

0 commit comments

Comments
 (0)