@@ -649,12 +649,14 @@ func TestPodStore(t *testing.T) {
649
649
},
650
650
},
651
651
Want : `
652
+ # HELP kube_pod_container_status_last_terminated_exitcode Describes the exit code for the last container in terminated state.
652
653
# HELP kube_pod_container_status_last_terminated_reason Describes the last reason the container was in terminated state.
653
654
# HELP kube_pod_container_status_running Describes whether the container is currently in running state.
654
655
# HELP kube_pod_container_status_terminated Describes whether the container is currently in terminated state.
655
656
# HELP kube_pod_container_status_terminated_reason Describes the reason the container is currently in terminated state.
656
657
# HELP kube_pod_container_status_waiting Describes whether the container is currently in waiting state.
657
658
# HELP kube_pod_container_status_waiting_reason Describes the reason the container is currently in waiting state.
659
+ # TYPE kube_pod_container_status_last_terminated_exitcode gauge
658
660
# TYPE kube_pod_container_status_last_terminated_reason gauge
659
661
# TYPE kube_pod_container_status_running gauge
660
662
# TYPE kube_pod_container_status_terminated gauge
@@ -679,6 +681,10 @@ func TestPodStore(t *testing.T) {
679
681
"kube_pod_container_status_last_terminated_reason" ,
680
682
"kube_pod_container_status_last_terminated_reason" ,
681
683
"kube_pod_container_status_last_terminated_reason" ,
684
+ "kube_pod_container_status_last_terminated_exitcode" ,
685
+ "kube_pod_container_status_last_terminated_exitcode" ,
686
+ "kube_pod_container_status_last_terminated_exitcode" ,
687
+ "kube_pod_container_status_last_terminated_exitcode" ,
682
688
},
683
689
},
684
690
{
@@ -720,13 +726,15 @@ func TestPodStore(t *testing.T) {
720
726
},
721
727
Want : `
722
728
# HELP kube_pod_container_status_last_terminated_reason Describes the last reason the container was in terminated state.
729
+ # HELP kube_pod_container_status_last_terminated_exitcode Describes the exit code for the last container in terminated state.
723
730
# HELP kube_pod_container_status_running Describes whether the container is currently in running state.
724
731
# HELP kube_pod_container_status_terminated Describes whether the container is currently in terminated state.
725
732
# HELP kube_pod_container_status_terminated_reason Describes the reason the container is currently in terminated state.
726
733
# HELP kube_pod_container_status_waiting Describes whether the container is currently in waiting state.
727
734
# HELP kube_pod_container_status_waiting_reason Describes the reason the container is currently in waiting state.
728
735
# HELP kube_pod_container_state_started Start time in unix timestamp for a pod container.
729
736
# TYPE kube_pod_container_status_last_terminated_reason gauge
737
+ # TYPE kube_pod_container_status_last_terminated_exitcode gauge
730
738
# TYPE kube_pod_container_status_running gauge
731
739
# TYPE kube_pod_container_status_terminated gauge
732
740
# TYPE kube_pod_container_status_terminated_reason gauge
@@ -737,10 +745,12 @@ func TestPodStore(t *testing.T) {
737
745
kube_pod_container_state_started{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 1.501777018e+09
738
746
kube_pod_container_status_terminated{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 0
739
747
kube_pod_container_status_waiting{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 0
740
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled",uid="uid6",exitcode="137"} 1
748
+ kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled",uid="uid6"} 1
749
+ kube_pod_container_status_last_terminated_exitcode{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled",uid="uid6"} 137
741
750
` ,
742
751
MetricNames : []string {
743
752
"kube_pod_container_status_last_terminated_reason" ,
753
+ "kube_pod_container_status_last_terminated_exitcode" ,
744
754
"kube_pod_container_status_running" ,
745
755
"kube_pod_container_state_started" ,
746
756
"kube_pod_container_status_terminated" ,
@@ -785,13 +795,15 @@ func TestPodStore(t *testing.T) {
785
795
},
786
796
},
787
797
Want : `
798
+ # HELP kube_pod_container_status_last_terminated_exitcode Describes the exit code for the last container in terminated state.
788
799
# HELP kube_pod_container_status_last_terminated_reason Describes the last reason the container was in terminated state.
789
800
# HELP kube_pod_container_status_running Describes whether the container is currently in running state.
790
801
# HELP kube_pod_container_state_started Start time in unix timestamp for a pod container.
791
802
# HELP kube_pod_container_status_terminated Describes whether the container is currently in terminated state.
792
803
# HELP kube_pod_container_status_terminated_reason Describes the reason the container is currently in terminated state.
793
804
# HELP kube_pod_container_status_waiting Describes whether the container is currently in waiting state.
794
805
# HELP kube_pod_container_status_waiting_reason Describes the reason the container is currently in waiting state.
806
+ # TYPE kube_pod_container_status_last_terminated_exitcode gauge
795
807
# TYPE kube_pod_container_status_last_terminated_reason gauge
796
808
# TYPE kube_pod_container_status_running gauge
797
809
# TYPE kube_pod_container_state_started gauge
@@ -800,7 +812,8 @@ func TestPodStore(t *testing.T) {
800
812
# TYPE kube_pod_container_status_waiting gauge
801
813
# TYPE kube_pod_container_status_waiting_reason gauge
802
814
kube_pod_container_state_started{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 1.501777018e+09
803
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7",exitcode="143"} 1
815
+ kube_pod_container_status_last_terminated_exitcode{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7"} 143
816
+ kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7"} 1
804
817
kube_pod_container_status_running{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 1
805
818
kube_pod_container_status_terminated{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 0
806
819
kube_pod_container_status_waiting{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 0
@@ -812,6 +825,7 @@ func TestPodStore(t *testing.T) {
812
825
"kube_pod_container_status_terminated_reason" ,
813
826
"kube_pod_container_status_waiting" ,
814
827
"kube_pod_container_status_last_terminated_reason" ,
828
+ "kube_pod_container_status_last_terminated_exitcode" ,
815
829
},
816
830
},
817
831
{
0 commit comments