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.
This commit is contained in:
Elana Hashman 2019-07-19 10:08:21 -07:00
parent 0fbfa755d3
commit e0b66c792b
No known key found for this signature in database
GPG Key ID: D37F7B2A20B48FA0
2 changed files with 1 additions and 3 deletions

View File

@ -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

View File

@ -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()))
}