diff --git a/internal/store/pod.go b/internal/store/pod.go index d597667e9..2c1eba924 100644 --- a/internal/store/pod.go +++ b/internal/store/pod.go @@ -1628,8 +1628,8 @@ func createPodStatusUnschedulableFamilyGenerator() generator.FamilyGenerator { for _, c := range p.Status.Conditions { if c.Type == v1.PodScheduled && c.Status == v1.ConditionFalse { ms = append(ms, &metric.Metric{ - LabelKeys: []string{}, - LabelValues: []string{}, + LabelKeys: []string{"reason"}, + LabelValues: []string{c.Message}, Value: 1, }) } diff --git a/internal/store/pod_test.go b/internal/store/pod_test.go index 8645e8707..a6b9b8918 100644 --- a/internal/store/pod_test.go +++ b/internal/store/pod_test.go @@ -1691,7 +1691,7 @@ func TestPodStore(t *testing.T) { Want: ` # HELP kube_pod_status_unschedulable [STABLE] Describes the unschedulable status for the pod. # TYPE kube_pod_status_unschedulable gauge - kube_pod_status_unschedulable{namespace="ns2",pod="pod2",uid="uid2"} 1 + kube_pod_status_unschedulable{namespace="ns2",pod="pod2",uid="uid2",reason="0/3 nodes are available: 3 Insufficient cpu."} 1 `, MetricNames: []string{"kube_pod_status_unschedulable"}, },