Skip to content

Commit e9c7e66

Browse files
committed
fix: Rename kube_pod_scheduler_name to kube_pod_scheduler
1 parent c5c6c9a commit e9c7e66

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

docs/pod-metrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
| kube_pod_status_unschedulable | Gauge | Describes the unschedulable status for the pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
5555
| kube_pod_tolerations | Gauge | Information about the pod tolerations | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; <br> `key`=&lt;toleration-key&gt; <br> `operator`=&lt;toleration-operator&gt; <br> `value`=&lt;toleration-value&gt; <br> `effect`=&lt;toleration-effect&gt; `toleration_seconds`=&lt;toleration-seconds&gt; | EXPERIMENTAL | - |
5656
| kube_pod_service_account | Gauge | The service account for a pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; <br> `service_account`=&lt;service_account&gt; | EXPERIMENTAL | - |
57-
| kube_pod_scheduler_name | Gauge | The scheduler name for a pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; <br> `scheduler_name`=&lt;scheduler_name&gt; | EXPERIMENTAL | - |
57+
| kube_pod_scheduler | Gauge | The scheduler for a pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; <br> `name`=&lt;scheduler-name&gt; | EXPERIMENTAL | - |
5858

5959
## Useful metrics queries
6060

internal/store/pod.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,14 +1711,14 @@ func createPodServiceAccountFamilyGenerator() generator.FamilyGenerator {
17111711

17121712
func createPodSchedulerNameFamilyGenerator() generator.FamilyGenerator {
17131713
return *generator.NewFamilyGeneratorWithStability(
1714-
"kube_pod_scheduler_name",
1715-
"The scheduler name for a pod.",
1714+
"kube_pod_scheduler",
1715+
"The scheduler for a pod.",
17161716
metric.Gauge,
17171717
basemetrics.ALPHA,
17181718
"",
17191719
wrapPodFunc(func(p *v1.Pod) *metric.Family {
17201720
m := metric.Metric{
1721-
LabelKeys: []string{"scheduler_name"},
1721+
LabelKeys: []string{"name"},
17221722
LabelValues: []string{p.Spec.SchedulerName},
17231723
Value: 1,
17241724
}

internal/store/pod_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,12 +2148,12 @@ func TestPodStore(t *testing.T) {
21482148
},
21492149
},
21502150
Want: `
2151-
# HELP kube_pod_scheduler_name The scheduler name for a pod.
2152-
# TYPE kube_pod_scheduler_name gauge
2153-
kube_pod_scheduler_name{namespace="ns1",pod="pod1",scheduler_name="scheduler1",uid="uid1"} 1
2151+
# HELP kube_pod_scheduler The scheduler for a pod.
2152+
# TYPE kube_pod_scheduler gauge
2153+
kube_pod_scheduler{namespace="ns1",pod="pod1",name="scheduler1",uid="uid1"} 1
21542154
`,
21552155
MetricNames: []string{
2156-
"kube_pod_scheduler_name",
2156+
"kube_pod_scheduler",
21572157
},
21582158
},
21592159
}

pkg/app/server_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func TestFullScrapeCycle(t *testing.T) {
235235
# HELP kube_pod_overhead_cpu_cores The pod overhead in regards to cpu cores associated with running a pod.
236236
# HELP kube_pod_overhead_memory_bytes The pod overhead in regards to memory associated with running a pod.
237237
# HELP kube_pod_runtimeclass_name_info The runtimeclass associated with the pod.
238-
# HELP kube_pod_scheduler_name The scheduler name for a pod.
238+
# HELP kube_pod_scheduler The scheduler for a pod.
239239
# HELP kube_pod_service_account The service account for a pod.
240240
# HELP kube_pod_owner [STABLE] Information about the Pod's owner.
241241
# HELP kube_pod_restart_policy [STABLE] Describes the restart policy in use by this pod.
@@ -287,7 +287,7 @@ func TestFullScrapeCycle(t *testing.T) {
287287
# TYPE kube_pod_overhead_cpu_cores gauge
288288
# TYPE kube_pod_overhead_memory_bytes gauge
289289
# TYPE kube_pod_runtimeclass_name_info gauge
290-
# TYPE kube_pod_scheduler_name gauge
290+
# TYPE kube_pod_scheduler gauge
291291
# TYPE kube_pod_service_account gauge
292292
# TYPE kube_pod_owner gauge
293293
# TYPE kube_pod_restart_policy gauge
@@ -338,7 +338,7 @@ kube_pod_created{namespace="default",pod="pod0",uid="abc-0"} 1.5e+09
338338
kube_pod_info{namespace="default",pod="pod0",uid="abc-0",host_ip="1.1.1.1",pod_ip="1.2.3.4",node="node1",created_by_kind="",created_by_name="",priority_class="",host_network="false"} 1
339339
kube_pod_owner{namespace="default",pod="pod0",uid="abc-0",owner_kind="",owner_name="",owner_is_controller=""} 1
340340
kube_pod_restart_policy{namespace="default",pod="pod0",uid="abc-0",type="Always"} 1
341-
kube_pod_scheduler_name{namespace="default",pod="pod0",uid="abc-0",scheduler_name="scheduler1"} 1
341+
kube_pod_scheduler{namespace="default",pod="pod0",uid="abc-0",name="scheduler1"} 1
342342
kube_pod_service_account{namespace="default",pod="pod0",uid="abc-0",service_account=""} 1
343343
kube_pod_status_phase{namespace="default",pod="pod0",uid="abc-0",phase="Failed"} 0
344344
kube_pod_status_phase{namespace="default",pod="pod0",uid="abc-0",phase="Pending"} 0

0 commit comments

Comments
 (0)