From c9bb45384a37e6664f50eecd4ed6c4d11a4c2592 Mon Sep 17 00:00:00 2001 From: Shaun Sabo Date: Wed, 8 Jun 2022 12:01:15 -0700 Subject: [PATCH 1/7] add exit code --- internal/store/pod.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/store/pod.go b/internal/store/pod.go index e593c67815..925a922c31 100644 --- a/internal/store/pod.go +++ b/internal/store/pod.go @@ -321,9 +321,12 @@ func createPodContainerStatusLastTerminatedReasonFamilyGenerator() generator.Fam for _, cs := range p.Status.ContainerStatuses { if cs.LastTerminationState.Terminated != nil { ms = append(ms, &metric.Metric{ - LabelKeys: []string{"container", "reason"}, - LabelValues: []string{cs.Name, cs.LastTerminationState.Terminated.Reason}, - Value: 1, + LabelKeys: []string{"container", "reason", "exitcode"}, + LabelValues: []string{ + cs.Name, + cs.LastTerminationState.Terminated.Reason, + strconv.Itoa(int(cs.LastTerminationState.Terminated.ExitCode))}, + Value: 1, }) } } From 1851bfae76ede3af9475bab8d567bce9b9bae498 Mon Sep 17 00:00:00 2001 From: Shaun Sabo Date: Wed, 8 Jun 2022 12:19:19 -0700 Subject: [PATCH 2/7] fix unitests --- internal/store/pod_test.go | 22 ++++++++++++++-------- pkg/app/server_test.go | 5 +++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/internal/store/pod_test.go b/internal/store/pod_test.go index 9e58232f2d..de3901d402 100644 --- a/internal/store/pod_test.go +++ b/internal/store/pod_test.go @@ -573,7 +573,8 @@ func TestPodStore(t *testing.T) { StartedAt: metav1.Time{ Time: time.Unix(1501777018, 0), }, - Reason: "OOMKilled", + Reason: "OOMKilled", + ExitCode: 137, }, }, }, @@ -709,7 +710,8 @@ func TestPodStore(t *testing.T) { }, LastTerminationState: v1.ContainerState{ Terminated: &v1.ContainerStateTerminated{ - Reason: "OOMKilled", + Reason: "OOMKilled", + ExitCode: 137, }, }, }, @@ -735,7 +737,7 @@ func TestPodStore(t *testing.T) { kube_pod_container_state_started{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 1.501777018e+09 kube_pod_container_status_terminated{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 0 kube_pod_container_status_waiting{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 0 - kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled",uid="uid6"} 1 + kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled",uid="uid6",exitcode="137"} 1 `, MetricNames: []string{ "kube_pod_container_status_last_terminated_reason", @@ -774,7 +776,8 @@ func TestPodStore(t *testing.T) { }, LastTerminationState: v1.ContainerState{ Terminated: &v1.ContainerStateTerminated{ - Reason: "DeadlineExceeded", + Reason: "DeadlineExceeded", + ExitCode: 143, }, }, }, @@ -797,7 +800,7 @@ func TestPodStore(t *testing.T) { # TYPE kube_pod_container_status_waiting gauge # TYPE kube_pod_container_status_waiting_reason gauge kube_pod_container_state_started{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 1.501777018e+09 - kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7"} 1 + kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7",exitcode="143"} 1 kube_pod_container_status_running{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 1 kube_pod_container_status_terminated{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 0 kube_pod_container_status_waiting{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 0 @@ -2019,7 +2022,8 @@ func BenchmarkPodStore(b *testing.B) { }, LastTerminationState: v1.ContainerState{ Terminated: &v1.ContainerStateTerminated{ - Reason: "OOMKilled", + Reason: "OOMKilled", + ExitCode: 137, }, }, }, @@ -2035,7 +2039,8 @@ func BenchmarkPodStore(b *testing.B) { }, LastTerminationState: v1.ContainerState{ Terminated: &v1.ContainerStateTerminated{ - Reason: "OOMKilled", + Reason: "OOMKilled", + ExitCode: 137, }, }, }, @@ -2051,7 +2056,8 @@ func BenchmarkPodStore(b *testing.B) { }, LastTerminationState: v1.ContainerState{ Terminated: &v1.ContainerStateTerminated{ - Reason: "OOMKilled", + Reason: "OOMKilled", + ExitCode: 137, }, }, }, diff --git a/pkg/app/server_test.go b/pkg/app/server_test.go index 71d77861d7..b9d73aef90 100644 --- a/pkg/app/server_test.go +++ b/pkg/app/server_test.go @@ -297,7 +297,7 @@ kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0", kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="storage",unit="byte"} 4e+08 kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con2",node="node1",resource="cpu",unit="core"} 0.3 kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con2",node="node1",resource="memory",unit="byte"} 2e+08 -kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",reason="OOMKilled"} 1 +kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",reason="OOMKilled",exitcode="137"} 1 kube_pod_container_status_ready{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1"} 0 kube_pod_container_status_ready{namespace="default",pod="pod0",uid="abc-0",container="pod1_con2"} 0 kube_pod_container_status_restarts_total{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1"} 0 @@ -794,7 +794,8 @@ func pod(client *fake.Clientset, index int) error { }, LastTerminationState: v1.ContainerState{ Terminated: &v1.ContainerStateTerminated{ - Reason: "OOMKilled", + Reason: "OOMKilled", + ExitCode: 137, }, }, }, From e31b0353197b529733e81b3d503cf5a5e470c3bc Mon Sep 17 00:00:00 2001 From: Shaun Sabo Date: Fri, 10 Jun 2022 10:03:54 -0700 Subject: [PATCH 3/7] create new metric --- internal/store/pod.go | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/internal/store/pod.go b/internal/store/pod.go index 925a922c31..701d9522dd 100644 --- a/internal/store/pod.go +++ b/internal/store/pod.go @@ -47,6 +47,7 @@ func podMetricFamilies(allowAnnotationsList, allowLabelsList []string) []generat createPodContainerResourceRequestsFamilyGenerator(), createPodContainerStateStartedFamilyGenerator(), createPodContainerStatusLastTerminatedReasonFamilyGenerator(), + createPodContainerStatusLastTerminatedExitCodeFamilyGenerator(), createPodContainerStatusReadyFamilyGenerator(), createPodContainerStatusRestartsTotalFamilyGenerator(), createPodContainerStatusRunningFamilyGenerator(), @@ -321,12 +322,34 @@ func createPodContainerStatusLastTerminatedReasonFamilyGenerator() generator.Fam for _, cs := range p.Status.ContainerStatuses { if cs.LastTerminationState.Terminated != nil { ms = append(ms, &metric.Metric{ - LabelKeys: []string{"container", "reason", "exitcode"}, - LabelValues: []string{ - cs.Name, - cs.LastTerminationState.Terminated.Reason, - strconv.Itoa(int(cs.LastTerminationState.Terminated.ExitCode))}, - Value: 1, + LabelKeys: []string{"container", "reason"}, + LabelValues: []string{cs.Name, cs.LastTerminationState.Terminated.Reason}, + Value: 1, + }) + } + } + + return &metric.Family{ + Metrics: ms, + } + }), + ) +} + +func createPodContainerStatusLastTerminatedExitCodeFamilyGenerator() generator.FamilyGenerator { + return *generator.NewFamilyGenerator( + "kube_pod_container_status_last_terminated_exitcode", + "Describes the exit code for the last container in terminated state.", + metric.Gauge, + "", + wrapPodFunc(func(p *v1.Pod) *metric.Family { + ms := make([]*metric.Metric, 0, len(p.Status.ContainerStatuses)) + for _, cs := range p.Status.ContainerStatuses { + if cs.LastTerminationState.Terminated != nil { + ms = append(ms, &metric.Metric{ + LabelKeys: []string{"container", "reason"}, + LabelValues: []string{cs.Name, cs.LastTerminationState.Terminated.Reason}, + Value: float64(cs.LastTerminationState.Terminated.ExitCode), }) } } From 085935314be9817e30a6d656752e88772324ae16 Mon Sep 17 00:00:00 2001 From: Shaun Sabo Date: Fri, 10 Jun 2022 10:40:35 -0700 Subject: [PATCH 4/7] unit tests --- internal/store/pod_test.go | 18 ++++++++++++++++-- pkg/app/server_test.go | 5 ++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/internal/store/pod_test.go b/internal/store/pod_test.go index de3901d402..bf1f102ad5 100644 --- a/internal/store/pod_test.go +++ b/internal/store/pod_test.go @@ -649,12 +649,14 @@ func TestPodStore(t *testing.T) { }, }, Want: ` + # HELP kube_pod_container_status_last_terminated_exitcode Describes the exit code for the last container in terminated state. # HELP kube_pod_container_status_last_terminated_reason Describes the last reason the container was in terminated state. # HELP kube_pod_container_status_running Describes whether the container is currently in running state. # HELP kube_pod_container_status_terminated Describes whether the container is currently in terminated state. # HELP kube_pod_container_status_terminated_reason Describes the reason the container is currently in terminated state. # HELP kube_pod_container_status_waiting Describes whether the container is currently in waiting state. # HELP kube_pod_container_status_waiting_reason Describes the reason the container is currently in waiting state. + # TYPE kube_pod_container_status_last_terminated_exitcode gauge # TYPE kube_pod_container_status_last_terminated_reason gauge # TYPE kube_pod_container_status_running gauge # TYPE kube_pod_container_status_terminated gauge @@ -679,6 +681,10 @@ func TestPodStore(t *testing.T) { "kube_pod_container_status_last_terminated_reason", "kube_pod_container_status_last_terminated_reason", "kube_pod_container_status_last_terminated_reason", + "kube_pod_container_status_last_terminated_exitcode", + "kube_pod_container_status_last_terminated_exitcode", + "kube_pod_container_status_last_terminated_exitcode", + "kube_pod_container_status_last_terminated_exitcode", }, }, { @@ -720,6 +726,7 @@ func TestPodStore(t *testing.T) { }, Want: ` # HELP kube_pod_container_status_last_terminated_reason Describes the last reason the container was in terminated state. + # HELP kube_pod_container_status_last_terminated_exitcode Describes the exit code for the last container in terminated state. # HELP kube_pod_container_status_running Describes whether the container is currently in running state. # HELP kube_pod_container_status_terminated Describes whether the container is currently in terminated state. # HELP kube_pod_container_status_terminated_reason Describes the reason the container is currently in terminated state. @@ -727,6 +734,7 @@ func TestPodStore(t *testing.T) { # HELP kube_pod_container_status_waiting_reason Describes the reason the container is currently in waiting state. # HELP kube_pod_container_state_started Start time in unix timestamp for a pod container. # TYPE kube_pod_container_status_last_terminated_reason gauge + # TYPE kube_pod_container_status_last_terminated_exitcode gauge # TYPE kube_pod_container_status_running gauge # TYPE kube_pod_container_status_terminated gauge # TYPE kube_pod_container_status_terminated_reason gauge @@ -737,10 +745,12 @@ func TestPodStore(t *testing.T) { kube_pod_container_state_started{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 1.501777018e+09 kube_pod_container_status_terminated{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 0 kube_pod_container_status_waiting{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 0 - kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled",uid="uid6",exitcode="137"} 1 + kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled",uid="uid6"} 1 + kube_pod_container_status_last_terminated_exitcode{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled",uid="uid6"} 137 `, MetricNames: []string{ "kube_pod_container_status_last_terminated_reason", + "kube_pod_container_status_last_terminated_exitcode", "kube_pod_container_status_running", "kube_pod_container_state_started", "kube_pod_container_status_terminated", @@ -785,6 +795,7 @@ func TestPodStore(t *testing.T) { }, }, Want: ` + # HELP kube_pod_container_status_last_terminated_exitcode Describes the exit code for the last container in terminated state. # HELP kube_pod_container_status_last_terminated_reason Describes the last reason the container was in terminated state. # HELP kube_pod_container_status_running Describes whether the container is currently in running state. # HELP kube_pod_container_state_started Start time in unix timestamp for a pod container. @@ -792,6 +803,7 @@ func TestPodStore(t *testing.T) { # HELP kube_pod_container_status_terminated_reason Describes the reason the container is currently in terminated state. # HELP kube_pod_container_status_waiting Describes whether the container is currently in waiting state. # HELP kube_pod_container_status_waiting_reason Describes the reason the container is currently in waiting state. + # TYPE kube_pod_container_status_last_terminated_exitcode gauge # TYPE kube_pod_container_status_last_terminated_reason gauge # TYPE kube_pod_container_status_running gauge # TYPE kube_pod_container_state_started gauge @@ -800,7 +812,8 @@ func TestPodStore(t *testing.T) { # TYPE kube_pod_container_status_waiting gauge # TYPE kube_pod_container_status_waiting_reason gauge kube_pod_container_state_started{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 1.501777018e+09 - kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7",exitcode="143"} 1 + kube_pod_container_status_last_terminated_exitcode{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7"} 143 + kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7"} 1 kube_pod_container_status_running{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 1 kube_pod_container_status_terminated{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 0 kube_pod_container_status_waiting{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 0 @@ -812,6 +825,7 @@ func TestPodStore(t *testing.T) { "kube_pod_container_status_terminated_reason", "kube_pod_container_status_waiting", "kube_pod_container_status_last_terminated_reason", + "kube_pod_container_status_last_terminated_exitcode", }, }, { diff --git a/pkg/app/server_test.go b/pkg/app/server_test.go index b9d73aef90..35843e080b 100644 --- a/pkg/app/server_test.go +++ b/pkg/app/server_test.go @@ -196,6 +196,7 @@ func TestFullScrapeCycle(t *testing.T) { # HELP kube_pod_container_resource_limits The number of requested limit resource by a container. # HELP kube_pod_container_resource_requests The number of requested request resource by a container. # HELP kube_pod_container_state_started Start time in unix timestamp for a pod container. +# HELP kube_pod_container_status_last_terminated_exitcode Describes the exit code for the last container in terminated state. # HELP kube_pod_container_status_last_terminated_reason Describes the last reason the container was in terminated state. # HELP kube_pod_container_status_ready Describes whether the containers readiness check succeeded. # HELP kube_pod_container_status_restarts_total The number of container restarts per container. @@ -241,6 +242,7 @@ func TestFullScrapeCycle(t *testing.T) { # TYPE kube_pod_container_resource_limits gauge # TYPE kube_pod_container_resource_requests gauge # TYPE kube_pod_container_state_started gauge +# TYPE kube_pod_container_status_last_terminated_exitcode gauge # TYPE kube_pod_container_status_last_terminated_reason gauge # TYPE kube_pod_container_status_ready gauge # TYPE kube_pod_container_status_restarts_total counter @@ -297,7 +299,8 @@ kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0", kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="storage",unit="byte"} 4e+08 kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con2",node="node1",resource="cpu",unit="core"} 0.3 kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con2",node="node1",resource="memory",unit="byte"} 2e+08 -kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",reason="OOMKilled",exitcode="137"} 1 +kube_pod_container_status_last_terminated_exitcode{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",reason="OOMKilled"} 137 +kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",reason="OOMKilled"} 1 kube_pod_container_status_ready{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1"} 0 kube_pod_container_status_ready{namespace="default",pod="pod0",uid="abc-0",container="pod1_con2"} 0 kube_pod_container_status_restarts_total{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1"} 0 From ffb6fe77e83418c8c1957e1a372751ae2db0f064 Mon Sep 17 00:00:00 2001 From: Shaun Sabo Date: Mon, 13 Jun 2022 09:41:09 -0700 Subject: [PATCH 5/7] remove reason from exitcode --- internal/store/pod.go | 4 ++-- internal/store/pod_test.go | 4 ++-- pkg/app/server_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/store/pod.go b/internal/store/pod.go index 701d9522dd..774fabaa00 100644 --- a/internal/store/pod.go +++ b/internal/store/pod.go @@ -347,8 +347,8 @@ func createPodContainerStatusLastTerminatedExitCodeFamilyGenerator() generator.F for _, cs := range p.Status.ContainerStatuses { if cs.LastTerminationState.Terminated != nil { ms = append(ms, &metric.Metric{ - LabelKeys: []string{"container", "reason"}, - LabelValues: []string{cs.Name, cs.LastTerminationState.Terminated.Reason}, + LabelKeys: []string{"container"}, + LabelValues: []string{cs.Name}, Value: float64(cs.LastTerminationState.Terminated.ExitCode), }) } diff --git a/internal/store/pod_test.go b/internal/store/pod_test.go index bf1f102ad5..551afa0400 100644 --- a/internal/store/pod_test.go +++ b/internal/store/pod_test.go @@ -746,7 +746,7 @@ func TestPodStore(t *testing.T) { kube_pod_container_status_terminated{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 0 kube_pod_container_status_waiting{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 0 kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled",uid="uid6"} 1 - kube_pod_container_status_last_terminated_exitcode{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled",uid="uid6"} 137 + kube_pod_container_status_last_terminated_exitcode{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 137 `, MetricNames: []string{ "kube_pod_container_status_last_terminated_reason", @@ -812,7 +812,7 @@ func TestPodStore(t *testing.T) { # TYPE kube_pod_container_status_waiting gauge # TYPE kube_pod_container_status_waiting_reason gauge kube_pod_container_state_started{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 1.501777018e+09 - kube_pod_container_status_last_terminated_exitcode{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7"} 143 + kube_pod_container_status_last_terminated_exitcode{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 143 kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7"} 1 kube_pod_container_status_running{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 1 kube_pod_container_status_terminated{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 0 diff --git a/pkg/app/server_test.go b/pkg/app/server_test.go index 35843e080b..e1012dc5af 100644 --- a/pkg/app/server_test.go +++ b/pkg/app/server_test.go @@ -299,7 +299,7 @@ kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0", kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="storage",unit="byte"} 4e+08 kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con2",node="node1",resource="cpu",unit="core"} 0.3 kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con2",node="node1",resource="memory",unit="byte"} 2e+08 -kube_pod_container_status_last_terminated_exitcode{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",reason="OOMKilled"} 137 +kube_pod_container_status_last_terminated_exitcode{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1"} 137 kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",reason="OOMKilled"} 1 kube_pod_container_status_ready{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1"} 0 kube_pod_container_status_ready{namespace="default",pod="pod0",uid="abc-0",container="pod1_con2"} 0 From eb3c14002cf15f35a4492bf938bf69a433263031 Mon Sep 17 00:00:00 2001 From: Shaun Sabo Date: Wed, 24 Aug 2022 13:07:04 -0700 Subject: [PATCH 6/7] fix test --- internal/store/pod_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/store/pod_test.go b/internal/store/pod_test.go index 551afa0400..e08a7cfb78 100644 --- a/internal/store/pod_test.go +++ b/internal/store/pod_test.go @@ -2079,7 +2079,7 @@ func BenchmarkPodStore(b *testing.B) { }, } - expectedFamilies := 46 + expectedFamilies := 47 for n := 0; n < b.N; n++ { families := f(pod) if len(families) != expectedFamilies { From 5bfe00666cac167f279da97d5eeb94054bd23cd1 Mon Sep 17 00:00:00 2001 From: Shaun Sabo Date: Wed, 24 Aug 2022 13:26:51 -0700 Subject: [PATCH 7/7] documentation --- docs/pod-metrics.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pod-metrics.md b/docs/pod-metrics.md index 06a545920a..5421d49c16 100644 --- a/docs/pod-metrics.md +++ b/docs/pod-metrics.md @@ -21,6 +21,7 @@ | kube_pod_container_status_terminated | Gauge | Describes whether the container is currently in terminated state | |`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE | - | | kube_pod_container_status_terminated_reason | Gauge | Describes the reason the container is currently in terminated state | |`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<container-terminated-reason>
`uid`=<pod-uid> | EXPERIMENTAL | - | | kube_pod_container_status_last_terminated_reason | Gauge | Describes the last reason the container was in terminated state | |`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<last-terminated-reason>
`uid`=<pod-uid> | EXPERIMENTAL | - | +| kube_pod_container_status_last_terminated_exitcode | Gauge | Describes the exit code for the last container in terminated state. | | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL | - | | kube_pod_container_status_ready | Gauge | Describes whether the containers readiness check succeeded | |`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE | - | | kube_pod_container_status_restarts_total | Counter | The number of container restarts per container | | `container`=<container-name>
`namespace`=<pod-namespace>
`pod`=<pod-name>
`uid`=<pod-uid> | STABLE | - | | kube_pod_container_resource_requests | Gauge | The number of requested request resource by a container | `cpu`=<core>
`memory`=<bytes> |`resource`=<resource-name>
`unit`=<resource-unit>
`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`node`=< node-name>
`uid`=<pod-uid> | EXPERIMENTAL | - |