Skip to content

Commit

Permalink
Drop "pod_name" and "container_name" metric labels
Browse files Browse the repository at this point in the history
These labels were deprecated in 1.14 (kubernetes#69099) and should no longer be
used in metric queries.
  • Loading branch information
ehashman committed Jul 19, 2019
1 parent 0fbfa75 commit e0b66c7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions pkg/kubelet/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/instrumentation/monitoring/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}

Expand Down

0 comments on commit e0b66c7

Please sign in to comment.