Skip to content

Commit e0b66c7

Browse files
committed
Drop "pod_name" and "container_name" metric labels
These labels were deprecated in 1.14 (kubernetes#69099) and should no longer be used in metric queries.
1 parent 0fbfa75 commit e0b66c7

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

pkg/kubelet/server/server.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,10 +932,8 @@ func containerPrometheusLabelsFunc(s stats.Provider) metrics.ContainerLabelsFunc
932932
metrics.LabelID: c.Name,
933933
metrics.LabelName: name,
934934
metrics.LabelImage: image,
935-
"pod_name": podName,
936935
"pod": podName,
937936
"namespace": namespace,
938-
"container_name": containerName,
939937
"container": containerName,
940938
}
941939
return set

test/e2e/instrumentation/monitoring/prometheus.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ var _ = instrumentation.SIGDescribe("[Feature:PrometheusMonitoring] Prometheus",
9292
})
9393

9494
func prometheusCPUQuery(namespace, podNamePrefix string, rate time.Duration) string {
95-
return fmt.Sprintf(`sum(irate(container_cpu_usage_seconds_total{namespace="%v",pod_name=~"%v.*",image!=""}[%vm]))`,
95+
return fmt.Sprintf(`sum(irate(container_cpu_usage_seconds_total{namespace="%v",pod=~"%v.*",image!=""}[%vm]))`,
9696
namespace, podNamePrefix, int64(rate.Minutes()))
9797
}
9898

0 commit comments

Comments
 (0)