mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc metric-server: Add name_ suffix to pod and namespace labels.
PiperOrigin-RevId: 516350308
This commit is contained in:
committed by
gVisor bot
parent
f01bf248c1
commit
ee8a6b9584
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user