runsc metric-server: Add name_ suffix to pod and namespace labels.

PiperOrigin-RevId: 516350308
This commit is contained in:
Etienne Perot
2023-03-13 16:17:10 -07:00
committed by gVisor bot
parent f01bf248c1
commit ee8a6b9584
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -265,7 +265,7 @@ non-human-friendly hexadecimal strings.
In order to provide more user-friendly labels, the metric server will pick up
the `io.kubernetes.cri.sandbox-name` and `io.kubernetes.cri.sandbox-namespace`
annotations provided by `containerd`, and automatically add these as labels
(`pod` and `namespace` respectively) for each per-sandbox metric.
(`pod_name` and `namespace_name` respectively) for each per-sandbox metric.
## Metrics exported
+2 -2
View File
@@ -35,8 +35,8 @@ var timeNow = time.Now
// Prometheus label names used to identify each sandbox.
const (
SandboxIDLabel = "sandbox"
PodNameLabel = "pod"
NamespaceLabel = "namespace"
PodNameLabel = "pod_name"
NamespaceLabel = "namespace_name"
IterationIDLabel = "iteration"
)
+2 -2
View File
@@ -360,10 +360,10 @@ func (m MetricData) GetPrometheusContainerInteger(want WantMetric) (int64, time.
"sandbox": want.Sandbox,
}
if want.Pod != "" {
labels["pod"] = want.Pod
labels["pod_name"] = want.Pod
}
if want.Namespace != "" {
labels["namespace"] = want.Namespace
labels["namespace_name"] = want.Namespace
}
return m.GetPrometheusInteger(want.Metric, labels)
}