From e0b66c792b8daabc8f2dcc5209356bca2cb2b197 Mon Sep 17 00:00:00 2001 From: Elana Hashman Date: Fri, 19 Jul 2019 10:08:21 -0700 Subject: [PATCH] Drop "pod_name" and "container_name" metric labels These labels were deprecated in 1.14 (#69099) and should no longer be used in metric queries. --- pkg/kubelet/server/server.go | 2 -- test/e2e/instrumentation/monitoring/prometheus.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/kubelet/server/server.go b/pkg/kubelet/server/server.go index aca56886189aa..7dfaf617b6105 100644 --- a/pkg/kubelet/server/server.go +++ b/pkg/kubelet/server/server.go @@ -932,10 +932,8 @@ func containerPrometheusLabelsFunc(s stats.Provider) metrics.ContainerLabelsFunc metrics.LabelID: c.Name, metrics.LabelName: name, metrics.LabelImage: image, - "pod_name": podName, "pod": podName, "namespace": namespace, - "container_name": containerName, "container": containerName, } return set diff --git a/test/e2e/instrumentation/monitoring/prometheus.go b/test/e2e/instrumentation/monitoring/prometheus.go index 1449b4e2214c2..76331f9c3a9d1 100644 --- a/test/e2e/instrumentation/monitoring/prometheus.go +++ b/test/e2e/instrumentation/monitoring/prometheus.go @@ -92,7 +92,7 @@ var _ = instrumentation.SIGDescribe("[Feature:PrometheusMonitoring] Prometheus", }) func prometheusCPUQuery(namespace, podNamePrefix string, rate time.Duration) string { - return fmt.Sprintf(`sum(irate(container_cpu_usage_seconds_total{namespace="%v",pod_name=~"%v.*",image!=""}[%vm]))`, + return fmt.Sprintf(`sum(irate(container_cpu_usage_seconds_total{namespace="%v",pod=~"%v.*",image!=""}[%vm]))`, namespace, podNamePrefix, int64(rate.Minutes())) }