Rename labels to match instrumentation guidelines

For the next release, we include both sets of labels for pods and
containers: "container_name" and "container", "pod_name" and "pod".
In future releases, the "*_name" metrics will be deprecated.
This commit is contained in:
Elana Hashman 2018-09-14 16:07:33 -04:00
parent 8b98e802ed
commit 3539e89af2
3 changed files with 11 additions and 1 deletions

View File

@ -39,7 +39,13 @@ var ProberResults = prometheus.NewGaugeVec(
Name: "probe_result",
Help: "The result of a liveness or readiness probe for a container.",
},
[]string{"probe_type", "container_name", "pod_name", "namespace", "pod_uid"},
[]string{"probe_type",
"container_name",
"container",
"pod_name",
"pod",
"namespace",
"pod_uid"},
)
// Manager manages pod probing. It creates a probe "worker" for every container that specifies a

View File

@ -101,7 +101,9 @@ func newWorker(
w.proberResultsMetricLabels = prometheus.Labels{
"probe_type": w.probeType.String(),
"container_name": w.container.Name,
"container": w.container.Name,
"pod_name": w.pod.Name,
"pod": w.pod.Name,
"namespace": w.pod.Namespace,
"pod_uid": string(w.pod.UID),
}

View File

@ -865,8 +865,10 @@ func containerPrometheusLabelsFunc(s stats.StatsProvider) metrics.ContainerLabel
metrics.LabelName: name,
metrics.LabelImage: image,
"pod_name": podName,
"pod": podName,
"namespace": namespace,
"container_name": containerName,
"container": containerName,
}
return set
}