mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Merge pull request #92407 from RainbowMango/pr_promlint_kubelet
change kubelet metrics name
This commit is contained in:
commit
f7b79c4ca4
@ -349,7 +349,7 @@ var (
|
|||||||
RunningPodCount = metrics.NewGauge(
|
RunningPodCount = metrics.NewGauge(
|
||||||
&metrics.GaugeOpts{
|
&metrics.GaugeOpts{
|
||||||
Subsystem: KubeletSubsystem,
|
Subsystem: KubeletSubsystem,
|
||||||
Name: "running_pod_count",
|
Name: "running_pods",
|
||||||
Help: "Number of pods currently running",
|
Help: "Number of pods currently running",
|
||||||
StabilityLevel: metrics.ALPHA,
|
StabilityLevel: metrics.ALPHA,
|
||||||
},
|
},
|
||||||
@ -358,7 +358,7 @@ var (
|
|||||||
RunningContainerCount = metrics.NewGaugeVec(
|
RunningContainerCount = metrics.NewGaugeVec(
|
||||||
&metrics.GaugeOpts{
|
&metrics.GaugeOpts{
|
||||||
Subsystem: KubeletSubsystem,
|
Subsystem: KubeletSubsystem,
|
||||||
Name: "running_container_count",
|
Name: "running_containers",
|
||||||
Help: "Number of containers currently running",
|
Help: "Number of containers currently running",
|
||||||
StabilityLevel: metrics.ALPHA,
|
StabilityLevel: metrics.ALPHA,
|
||||||
},
|
},
|
||||||
|
@ -682,22 +682,22 @@ func TestRunningPodAndContainerCount(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "test container count",
|
name: "test container count",
|
||||||
metricsName: "kubelet_running_container_count",
|
metricsName: "kubelet_running_containers",
|
||||||
wants: `
|
wants: `
|
||||||
# HELP kubelet_running_container_count [ALPHA] Number of containers currently running
|
# HELP kubelet_running_containers [ALPHA] Number of containers currently running
|
||||||
# TYPE kubelet_running_container_count gauge
|
# TYPE kubelet_running_containers gauge
|
||||||
kubelet_running_container_count{container_state="exited"} 1
|
kubelet_running_containers{container_state="exited"} 1
|
||||||
kubelet_running_container_count{container_state="running"} 1
|
kubelet_running_containers{container_state="running"} 1
|
||||||
kubelet_running_container_count{container_state="unknown"} 2
|
kubelet_running_containers{container_state="unknown"} 2
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "test pod count",
|
name: "test pod count",
|
||||||
metricsName: "kubelet_running_pod_count",
|
metricsName: "kubelet_running_pods",
|
||||||
wants: `
|
wants: `
|
||||||
# HELP kubelet_running_pod_count [ALPHA] Number of pods currently running
|
# HELP kubelet_running_pods [ALPHA] Number of pods currently running
|
||||||
# TYPE kubelet_running_pod_count gauge
|
# TYPE kubelet_running_pods gauge
|
||||||
kubelet_running_pod_count 2
|
kubelet_running_pods 2
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -64,12 +64,9 @@ var exceptionMetrics = []string{
|
|||||||
"node_collector_evictions_number",
|
"node_collector_evictions_number",
|
||||||
|
|
||||||
// k8s.io/kubernetes/pkg/kubelet/server/stats
|
// k8s.io/kubernetes/pkg/kubelet/server/stats
|
||||||
|
// The two metrics have been deprecated and will be removed in release v1.20+.
|
||||||
"container_cpu_usage_seconds_total", // non-counter metrics should not have "_total" suffix
|
"container_cpu_usage_seconds_total", // non-counter metrics should not have "_total" suffix
|
||||||
"node_cpu_usage_seconds_total", // non-counter metrics should not have "_total" suffix
|
"node_cpu_usage_seconds_total", // non-counter metrics should not have "_total" suffix
|
||||||
|
|
||||||
// k8s.io/kubernetes/pkg/kubelet/pleg
|
|
||||||
"kubelet_running_container_count", // non-histogram and non-summary metrics should not have "_count" suffix
|
|
||||||
"kubelet_running_pod_count", // non-histogram and non-summary metrics should not have "_count" suffix
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// A Problem is an issue detected by a Linter.
|
// A Problem is an issue detected by a Linter.
|
||||||
|
Loading…
Reference in New Issue
Block a user