diff --git a/docs/pod-metrics.md b/docs/pod-metrics.md
index 44750d8332..039e7c7cb2 100644
--- a/docs/pod-metrics.md
+++ b/docs/pod-metrics.md
@@ -3,55 +3,55 @@
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_pod_info | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`host_ip`=<host-ip>
`pod_ip`=<pod-ip>
`node`=<node-name>
`created_by_kind`=<created_by_kind>
`created_by_name`=<created_by_name>
`uid`=<pod-uid>
`priority_class`=<priority_class>
`host_network`=<host_network>| STABLE |
-| kube_pod_start_time | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_completion_time | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_owner | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`owner_kind`=<owner kind>
`owner_name`=<owner name>
`owner_is_controller`=<whether owner is controller> | STABLE |
-| kube_pod_labels | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`label_POD_LABEL`=<POD_LABEL> | STABLE |
-| kube_pod_status_phase | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`phase`=<Pending\|Running\|Succeeded\|Failed\|Unknown> | STABLE |
-| kube_pod_status_ready | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`condition`=<true\|false\|unknown> | STABLE |
-| kube_pod_status_scheduled | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`condition`=<true\|false\|unknown> | STABLE |
-| kube_pod_container_info | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`image`=<image-name>
`image_id`=<image-id>
`container_id`=<containerid> | STABLE |
-| kube_pod_container_status_waiting | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_container_status_waiting_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<ContainerCreating\|CrashLoopBackOff\|ErrImagePull\|ImagePullBackOff\|CreateContainerConfigError\|InvalidImageName\|CreateContainerError> | STABLE |
-| kube_pod_container_status_running | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_container_state_started | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_container_status_terminated | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_container_status_terminated_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<OOMKilled\|Error\|Completed\|ContainerCannotRun\|DeadlineExceeded\|Evicted> | STABLE |
-| kube_pod_container_status_last_terminated_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<OOMKilled\|Error\|Completed\|ContainerCannotRun\|DeadlineExceeded\|Evicted> | STABLE |
-| kube_pod_container_status_ready | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_container_status_restarts_total | Counter | `container`=<container-name>
`namespace`=<pod-namespace>
`pod`=<pod-name> | STABLE |
-| kube_pod_container_resource_requests | Gauge | `resource`=<resource-name>
`unit`=<resource-unit>
`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`node`=< node-name> | EXPERIMENTAL |
-| kube_pod_container_resource_limits | Gauge | `resource`=<resource-name>
`unit`=<resource-unit>
`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`node`=< node-name> | EXPERIMENTAL |
-| kube_pod_overhead_cpu_cores | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_overhead_memory_bytes | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_runtimeclass_name_info | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_created | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_deletion_timestamp | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_restart_policy | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`type`=<Always\|Never\|OnFailure> | STABLE |
-| kube_pod_init_container_info | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`image`=<image-name>
`image_id`=<image-id>
`container_id`=<containerid> | STABLE |
-| kube_pod_init_container_status_waiting | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_init_container_status_waiting_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<ContainerCreating\|CrashLoopBackOff\|ErrImagePull\|ImagePullBackOff\|CreateContainerConfigError\|CreateContainerError\|InvalidImageName> | STABLE |
-| kube_pod_init_container_status_running | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_init_container_status_terminated | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_init_container_status_terminated_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<OOMKilled\|Error\|Completed\|ContainerCannotRun\|DeadlineExceeded\|Evicted> | STABLE |
-| kube_pod_init_container_status_last_terminated_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<OOMKilled\|Error\|Completed\|ContainerCannotRun\|DeadlineExceeded\|Evicted> | STABLE |
-| kube_pod_init_container_status_ready | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_init_container_status_restarts_total | Counter | `container`=<container-name>
`namespace`=<pod-namespace>
`pod`=<pod-name> | STABLE |
-| kube_pod_init_container_resource_limits | Gauge | `resource`=<resource-name>
`unit`=<resource-unit>
`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_init_container_resource_limits_cpu_cores | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_init_container_resource_limits_memory_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_init_container_resource_limits_storage_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_init_container_resource_limits_ephemeral_storage_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_init_container_resource_requests | Gauge | `resource`=<resource-name>
`unit`=<resource-unit>
`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_init_container_resource_requests_cpu_cores | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_init_container_resource_requests_memory_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_init_container_resource_requests_storage_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_init_container_resource_requests_ephemeral_storage_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace> | EXPERIMENTAL |
-| kube_pod_spec_volumes_persistentvolumeclaims_info | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`volume`=<volume-name>
`persistentvolumeclaim`=<persistentvolumeclaim-claimname> | STABLE |
-| kube_pod_spec_volumes_persistentvolumeclaims_readonly | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`volume`=<volume-name>
`persistentvolumeclaim`=<persistentvolumeclaim-claimname> | STABLE |
-| kube_pod_status_reason | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<NodeLost\|Evicted\|UnexpectedAdmissionError> | EXPERIMENTAL |
-| kube_pod_status_scheduled_time | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
-| kube_pod_status_unschedulable | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace> | STABLE |
+| kube_pod_start_time | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_completion_time | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_owner | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`owner_kind`=<owner kind>
`owner_name`=<owner name>
`owner_is_controller`=<whether owner is controller>
`uid`=<pod-uid> | STABLE |
+| kube_pod_labels | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`label_POD_LABEL`=<POD_LABEL>
`uid`=<pod-uid> | STABLE |
+| kube_pod_status_phase | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`phase`=<Pending\|Running\|Succeeded\|Failed\|Unknown>
`uid`=<pod-uid> | STABLE |
+| kube_pod_status_ready | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`condition`=<true\|false\|unknown>
`uid`=<pod-uid> | STABLE |
+| kube_pod_status_scheduled | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`condition`=<true\|false\|unknown>
`uid`=<pod-uid> | STABLE |
+| kube_pod_container_info | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`image`=<image-name>
`image_id`=<image-id>
`container_id`=<containerid>
`uid`=<pod-uid> | STABLE |
+| kube_pod_container_status_waiting | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_container_status_waiting_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<ContainerCreating\|CrashLoopBackOff\|ErrImagePull\|ImagePullBackOff\|CreateContainerConfigError\|InvalidImageName\|CreateContainerError>
`uid`=<pod-uid> | STABLE |
+| kube_pod_container_status_running | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_container_state_started | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_container_status_terminated | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_container_status_terminated_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<OOMKilled\|Error\|Completed\|ContainerCannotRun\|DeadlineExceeded\|Evicted>
`uid`=<pod-uid> | STABLE |
+| kube_pod_container_status_last_terminated_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<OOMKilled\|Error\|Completed\|ContainerCannotRun\|DeadlineExceeded\|Evicted>
`uid`=<pod-uid> | STABLE |
+| kube_pod_container_status_ready | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_container_status_restarts_total | Counter | `container`=<container-name>
`namespace`=<pod-namespace>
`pod`=<pod-name>
`uid`=<pod-uid> | STABLE |
+| kube_pod_container_resource_requests | Gauge | `resource`=<resource-name>
`unit`=<resource-unit>
`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`node`=< node-name>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_container_resource_limits | Gauge | `resource`=<resource-name>
`unit`=<resource-unit>
`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`node`=< node-name>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_overhead_cpu_cores | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_overhead_memory_bytes | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_runtimeclass_name_info | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_created | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_deletion_timestamp | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_restart_policy | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`type`=<Always\|Never\|OnFailure>
`uid`=<pod-uid> | STABLE |
+| kube_pod_init_container_info | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`image`=<image-name>
`image_id`=<image-id>
`container_id`=<containerid>
`uid`=<pod-uid> | STABLE |
+| kube_pod_init_container_status_waiting | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_init_container_status_waiting_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<ContainerCreating\|CrashLoopBackOff\|ErrImagePull\|ImagePullBackOff\|CreateContainerConfigError\|CreateContainerError\|InvalidImageName>
`uid`=<pod-uid> | STABLE |
+| kube_pod_init_container_status_running | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_init_container_status_terminated | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_init_container_status_terminated_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<OOMKilled\|Error\|Completed\|ContainerCannotRun\|DeadlineExceeded\|Evicted>
`uid`=<pod-uid> | STABLE |
+| kube_pod_init_container_status_last_terminated_reason | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<OOMKilled\|Error\|Completed\|ContainerCannotRun\|DeadlineExceeded\|Evicted>
`uid`=<pod-uid> | STABLE |
+| kube_pod_init_container_status_ready | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_init_container_status_restarts_total | Counter | `container`=<container-name>
`namespace`=<pod-namespace>
`pod`=<pod-name>
`uid`=<pod-uid> | STABLE |
+| kube_pod_init_container_resource_limits | Gauge | `resource`=<resource-name>
`unit`=<resource-unit>
`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_init_container_resource_limits_cpu_cores | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_init_container_resource_limits_memory_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_init_container_resource_limits_storage_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_init_container_resource_limits_ephemeral_storage_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_init_container_resource_requests | Gauge | `resource`=<resource-name>
`unit`=<resource-unit>
`container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_init_container_resource_requests_cpu_cores | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_init_container_resource_requests_memory_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_init_container_resource_requests_storage_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_init_container_resource_requests_ephemeral_storage_bytes | Gauge | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_spec_volumes_persistentvolumeclaims_info | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`volume`=<volume-name>
`persistentvolumeclaim`=<persistentvolumeclaim-claimname>
`uid`=<pod-uid> | STABLE |
+| kube_pod_spec_volumes_persistentvolumeclaims_readonly | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`volume`=<volume-name>
`persistentvolumeclaim`=<persistentvolumeclaim-claimname>
`uid`=<pod-uid> | STABLE |
+| kube_pod_status_reason | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`reason`=<NodeLost\|Evicted\|UnexpectedAdmissionError>
`uid`=<pod-uid> | EXPERIMENTAL |
+| kube_pod_status_scheduled_time | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
+| kube_pod_status_unschedulable | Gauge | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE |
## Useful metrics queries
diff --git a/internal/store/pod.go b/internal/store/pod.go
index b57554925b..c81f1d728d 100644
--- a/internal/store/pod.go
+++ b/internal/store/pod.go
@@ -33,7 +33,7 @@ import (
)
var (
- descPodLabelsDefaultLabels = []string{"namespace", "pod"}
+ descPodLabelsDefaultLabels = []string{"namespace", "pod", "uid"}
containerWaitingReasons = []string{"ContainerCreating", "CrashLoopBackOff", "CreateContainerConfigError", "ErrImagePull", "ImagePullBackOff", "CreateContainerError", "InvalidImageName"}
containerTerminatedReasons = []string{"OOMKilled", "Completed", "Error", "ContainerCannotRun", "DeadlineExceeded", "Evicted"}
podStatusReasons = []string{"NodeLost", "Evicted", "UnexpectedAdmissionError"}
@@ -59,8 +59,8 @@ var (
m := metric.Metric{
- LabelKeys: []string{"host_ip", "pod_ip", "uid", "node", "created_by_kind", "created_by_name", "priority_class", "host_network"},
- LabelValues: []string{p.Status.HostIP, p.Status.PodIP, string(p.UID), p.Spec.NodeName, createdByKind, createdByName, p.Spec.PriorityClassName, strconv.FormatBool(p.Spec.HostNetwork)},
+ LabelKeys: []string{"host_ip", "pod_ip", "node", "created_by_kind", "created_by_name", "priority_class", "host_network"},
+ LabelValues: []string{p.Status.HostIP, p.Status.PodIP, p.Spec.NodeName, createdByKind, createdByName, p.Spec.PriorityClassName, strconv.FormatBool(p.Spec.HostNetwork)},
Value: 1,
}
@@ -1367,7 +1367,7 @@ func wrapPodFunc(f func(*v1.Pod) *metric.Family) func(interface{}) *metric.Famil
for _, m := range metricFamily.Metrics {
m.LabelKeys = append(descPodLabelsDefaultLabels, m.LabelKeys...)
- m.LabelValues = append([]string{pod.Namespace, pod.Name}, m.LabelValues...)
+ m.LabelValues = append([]string{pod.Namespace, pod.Name, string(pod.UID)}, m.LabelValues...)
}
return metricFamily
diff --git a/internal/store/pod_test.go b/internal/store/pod_test.go
index 73265969e7..26133ffb4d 100644
--- a/internal/store/pod_test.go
+++ b/internal/store/pod_test.go
@@ -39,6 +39,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -54,7 +55,7 @@ func TestPodStore(t *testing.T) {
Want: `
# HELP kube_pod_container_info Information about a container in a pod.
# TYPE kube_pod_container_info gauge
- kube_pod_container_info{container="container1",container_id="docker://ab123",image="k8s.gcr.io/hyperkube1",image_id="docker://sha256:aaa",namespace="ns1",pod="pod1"} 1`,
+ kube_pod_container_info{container="container1",container_id="docker://ab123",image="k8s.gcr.io/hyperkube1",image_id="docker://sha256:aaa",namespace="ns1",pod="pod1",uid="uid1"} 1`,
MetricNames: []string{"kube_pod_container_info"},
},
{
@@ -62,6 +63,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -93,9 +95,9 @@ func TestPodStore(t *testing.T) {
# HELP kube_pod_init_container_info Information about an init container in a pod.
# TYPE kube_pod_container_info gauge
# TYPE kube_pod_init_container_info gauge
- kube_pod_container_info{container="container2",container_id="docker://cd456",image="k8s.gcr.io/hyperkube2",image_id="docker://sha256:bbb",namespace="ns2",pod="pod2"} 1
- kube_pod_container_info{container="container3",container_id="docker://ef789",image="k8s.gcr.io/hyperkube3",image_id="docker://sha256:ccc",namespace="ns2",pod="pod2"} 1
- kube_pod_init_container_info{container="initContainer",container_id="docker://ef123",image="k8s.gcr.io/initfoo",image_id="docker://sha256:wxyz",namespace="ns2",pod="pod2"} 1`,
+ kube_pod_container_info{container="container2",container_id="docker://cd456",image="k8s.gcr.io/hyperkube2",image_id="docker://sha256:bbb",namespace="ns2",pod="pod2",uid="uid2"} 1
+ kube_pod_container_info{container="container3",container_id="docker://ef789",image="k8s.gcr.io/hyperkube3",image_id="docker://sha256:ccc",namespace="ns2",pod="pod2",uid="uid2"} 1
+ kube_pod_init_container_info{container="initContainer",container_id="docker://ef123",image="k8s.gcr.io/initfoo",image_id="docker://sha256:wxyz",namespace="ns2",pod="pod2",uid="uid2"} 1`,
MetricNames: []string{"kube_pod_container_info", "kube_pod_init_container_info"},
},
{
@@ -103,6 +105,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -116,7 +119,7 @@ func TestPodStore(t *testing.T) {
Want: `
# HELP kube_pod_container_status_ready Describes whether the containers readiness check succeeded.
# TYPE kube_pod_container_status_ready gauge
- kube_pod_container_status_ready{container="container1",namespace="ns1",pod="pod1"} 1`,
+ kube_pod_container_status_ready{container="container1",namespace="ns1",pod="pod1",uid="uid1"} 1`,
MetricNames: []string{"kube_pod_container_status_ready"},
},
{
@@ -124,6 +127,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -141,8 +145,8 @@ func TestPodStore(t *testing.T) {
Want: `
# HELP kube_pod_container_status_ready Describes whether the containers readiness check succeeded.
# TYPE kube_pod_container_status_ready gauge
- kube_pod_container_status_ready{container="container2",namespace="ns2",pod="pod2"} 1
- kube_pod_container_status_ready{container="container3",namespace="ns2",pod="pod2"} 0
+ kube_pod_container_status_ready{container="container2",namespace="ns2",pod="pod2",uid="uid2"} 1
+ kube_pod_container_status_ready{container="container3",namespace="ns2",pod="pod2",uid="uid2"} 0
`,
MetricNames: []string{"kube_pod_container_status_ready"},
},
@@ -151,6 +155,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod3",
Namespace: "ns3",
+ UID: "uid3",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -178,8 +183,8 @@ func TestPodStore(t *testing.T) {
Want: `
# HELP kube_pod_init_container_status_ready Describes whether the init containers readiness check succeeded.
# TYPE kube_pod_init_container_status_ready gauge
- kube_pod_init_container_status_ready{container="initcontainer1",namespace="ns3",pod="pod3"} 1
- kube_pod_init_container_status_ready{container="initcontainer2",namespace="ns3",pod="pod3"} 0
+ kube_pod_init_container_status_ready{container="initcontainer1",namespace="ns3",pod="pod3",uid="uid3"} 1
+ kube_pod_init_container_status_ready{container="initcontainer2",namespace="ns3",pod="pod3",uid="uid3"} 0
`,
MetricNames: []string{"kube_pod_init_container_status_ready"},
},
@@ -188,6 +193,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -201,7 +207,7 @@ func TestPodStore(t *testing.T) {
Want: `
# HELP kube_pod_container_status_restarts_total The number of container restarts per container.
# TYPE kube_pod_container_status_restarts_total counter
- kube_pod_container_status_restarts_total{container="container1",namespace="ns1",pod="pod1"} 0
+ kube_pod_container_status_restarts_total{container="container1",namespace="ns1",pod="pod1",uid="uid1"} 0
`,
MetricNames: []string{"kube_pod_container_status_restarts_total"},
},
@@ -210,6 +216,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Status: v1.PodStatus{
InitContainerStatuses: []v1.ContainerStatus{
@@ -223,7 +230,7 @@ func TestPodStore(t *testing.T) {
Want: `
# HELP kube_pod_init_container_status_restarts_total The number of restarts for the init container.
# TYPE kube_pod_init_container_status_restarts_total counter
- kube_pod_init_container_status_restarts_total{container="initcontainer1",namespace="ns2",pod="pod2"} 1
+ kube_pod_init_container_status_restarts_total{container="initcontainer1",namespace="ns2",pod="pod2",uid="uid2"} 1
`,
MetricNames: []string{"kube_pod_init_container_status_restarts_total"},
},
@@ -232,6 +239,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -249,8 +257,8 @@ func TestPodStore(t *testing.T) {
Want: `
# HELP kube_pod_container_status_restarts_total The number of container restarts per container.
# TYPE kube_pod_container_status_restarts_total counter
- kube_pod_container_status_restarts_total{container="container2",namespace="ns2",pod="pod2"} 0
- kube_pod_container_status_restarts_total{container="container3",namespace="ns2",pod="pod2"} 1
+ kube_pod_container_status_restarts_total{container="container2",namespace="ns2",pod="pod2",uid="uid2"} 0
+ kube_pod_container_status_restarts_total{container="container3",namespace="ns2",pod="pod2",uid="uid2"} 1
`,
MetricNames: []string{"kube_pod_container_status_restarts_total"},
},
@@ -259,6 +267,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Status: v1.PodStatus{
InitContainerStatuses: []v1.ContainerStatus{
@@ -276,8 +285,8 @@ func TestPodStore(t *testing.T) {
Want: `
# HELP kube_pod_init_container_status_restarts_total The number of restarts for the init container.
# TYPE kube_pod_init_container_status_restarts_total counter
- kube_pod_init_container_status_restarts_total{container="initcontainer2",namespace="ns2",pod="pod2"} 0
- kube_pod_init_container_status_restarts_total{container="initcontainer3",namespace="ns2",pod="pod2"} 1
+ kube_pod_init_container_status_restarts_total{container="initcontainer2",namespace="ns2",pod="pod2",uid="uid2"} 0
+ kube_pod_init_container_status_restarts_total{container="initcontainer3",namespace="ns2",pod="pod2",uid="uid2"} 1
`,
MetricNames: []string{"kube_pod_init_container_status_restarts_total"},
},
@@ -286,6 +295,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -333,39 +343,39 @@ func TestPodStore(t *testing.T) {
# TYPE kube_pod_init_container_status_terminated_reason gauge
# TYPE kube_pod_init_container_status_waiting gauge
# TYPE kube_pod_init_container_status_waiting_reason gauge
- kube_pod_container_status_running{container="container1",namespace="ns1",pod="pod1"} 1
- kube_pod_container_state_started{container="container1",namespace="ns1",pod="pod1"} 1.501777018e+09
- kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="Completed"} 0
- kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="ContainerCannotRun"} 0
- kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="Error"} 0
- kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="Evicted"} 0
- kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="OOMKilled"} 0
- kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="DeadlineExceeded"} 0
- kube_pod_container_status_terminated{container="container1",namespace="ns1",pod="pod1"} 0
- kube_pod_container_status_waiting{container="container1",namespace="ns1",pod="pod1"} 0
- kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="ContainerCreating"} 0
- kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="ImagePullBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="CrashLoopBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="ErrImagePull"} 0
- kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="CreateContainerConfigError"} 0
- kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="CreateContainerError"} 0
- kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="InvalidImageName"} 0
- kube_pod_init_container_status_running{container="initcontainer1",namespace="ns1",pod="pod1"} 1
- kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="Completed"} 0
- kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="ContainerCannotRun"} 0
- kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="Error"} 0
- kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="Evicted"} 0
- kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="OOMKilled"} 0
- kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="DeadlineExceeded"} 0
- kube_pod_init_container_status_terminated{container="initcontainer1",namespace="ns1",pod="pod1"} 0
- kube_pod_init_container_status_waiting{container="initcontainer1",namespace="ns1",pod="pod1"} 0
- kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="ContainerCreating"} 0
- kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="ImagePullBackOff"} 0
- kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="CrashLoopBackOff"} 0
- kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="ErrImagePull"} 0
- kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="CreateContainerConfigError"} 0
- kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="CreateContainerError"} 0
- kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="InvalidImageName"} 0
+ kube_pod_container_status_running{container="container1",namespace="ns1",pod="pod1",uid="uid1"} 1
+ kube_pod_container_state_started{container="container1",namespace="ns1",pod="pod1",uid="uid1"} 1.501777018e+09
+ kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="Completed",uid="uid1"} 0
+ kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="ContainerCannotRun",uid="uid1"} 0
+ kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="Error",uid="uid1"} 0
+ kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="Evicted",uid="uid1"} 0
+ kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="OOMKilled",uid="uid1"} 0
+ kube_pod_container_status_terminated_reason{container="container1",namespace="ns1",pod="pod1",reason="DeadlineExceeded",uid="uid1"} 0
+ kube_pod_container_status_terminated{container="container1",namespace="ns1",pod="pod1",uid="uid1"} 0
+ kube_pod_container_status_waiting{container="container1",namespace="ns1",pod="pod1",uid="uid1"} 0
+ kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="ContainerCreating",uid="uid1"} 0
+ kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="ImagePullBackOff",uid="uid1"} 0
+ kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="CrashLoopBackOff",uid="uid1"} 0
+ kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="ErrImagePull",uid="uid1"} 0
+ kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="CreateContainerConfigError",uid="uid1"} 0
+ kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="CreateContainerError",uid="uid1"} 0
+ kube_pod_container_status_waiting_reason{container="container1",namespace="ns1",pod="pod1",reason="InvalidImageName",uid="uid1"} 0
+ kube_pod_init_container_status_running{container="initcontainer1",namespace="ns1",pod="pod1",uid="uid1"} 1
+ kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="Completed",uid="uid1"} 0
+ kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="ContainerCannotRun",uid="uid1"} 0
+ kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="Error",uid="uid1"} 0
+ kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="Evicted",uid="uid1"} 0
+ kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="OOMKilled",uid="uid1"} 0
+ kube_pod_init_container_status_terminated_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="DeadlineExceeded",uid="uid1"} 0
+ kube_pod_init_container_status_terminated{container="initcontainer1",namespace="ns1",pod="pod1",uid="uid1"} 0
+ kube_pod_init_container_status_waiting{container="initcontainer1",namespace="ns1",pod="pod1",uid="uid1"} 0
+ kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="ContainerCreating",uid="uid1"} 0
+ kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="ImagePullBackOff",uid="uid1"} 0
+ kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="CrashLoopBackOff",uid="uid1"} 0
+ kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="ErrImagePull",uid="uid1"} 0
+ kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="CreateContainerConfigError",uid="uid1"} 0
+ kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="CreateContainerError",uid="uid1"} 0
+ kube_pod_init_container_status_waiting_reason{container="initcontainer1",namespace="ns1",pod="pod1",reason="InvalidImageName",uid="uid1"} 0
`,
MetricNames: []string{
"kube_pod_container_status_running",
@@ -386,6 +396,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -419,38 +430,38 @@ func TestPodStore(t *testing.T) {
# TYPE kube_pod_container_status_terminated_reason gauge
# TYPE kube_pod_container_status_waiting gauge
# TYPE kube_pod_container_status_waiting_reason gauge
- kube_pod_container_status_running{container="container2",namespace="ns2",pod="pod2"} 0
- kube_pod_container_status_running{container="container3",namespace="ns2",pod="pod2"} 0
- kube_pod_container_status_terminated{container="container2",namespace="ns2",pod="pod2"} 1
- kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="Completed"} 0
- kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="ContainerCannotRun"} 0
- kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="Error"} 0
- kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="Evicted"} 0
- kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="OOMKilled"} 1
- kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="DeadlineExceeded"} 0
- kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="Completed"} 0
- kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="ContainerCannotRun"} 0
- kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="Error"} 0
- kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="Evicted"} 0
- kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="OOMKilled"} 0
- kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="DeadlineExceeded"} 0
- kube_pod_container_status_waiting{container="container2",namespace="ns2",pod="pod2"} 0
- kube_pod_container_status_waiting{container="container3",namespace="ns2",pod="pod2"} 1
- kube_pod_container_status_terminated{container="container3",namespace="ns2",pod="pod2"} 0
- kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="ContainerCreating"} 0
- kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="ImagePullBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="CrashLoopBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="ErrImagePull"} 0
- kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="CreateContainerConfigError"} 0
- kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="CreateContainerError"} 0
- kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="InvalidImageName"} 0
- kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="ContainerCreating"} 1
- kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="CrashLoopBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="ErrImagePull"} 0
- kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="ImagePullBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="CreateContainerConfigError"} 0
- kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="CreateContainerError"} 0
- kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="InvalidImageName"} 0
+ kube_pod_container_status_running{container="container2",namespace="ns2",pod="pod2",uid="uid2"} 0
+ kube_pod_container_status_running{container="container3",namespace="ns2",pod="pod2",uid="uid2"} 0
+ kube_pod_container_status_terminated{container="container2",namespace="ns2",pod="pod2",uid="uid2"} 1
+ kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="Completed",uid="uid2"} 0
+ kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="ContainerCannotRun",uid="uid2"} 0
+ kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="Error",uid="uid2"} 0
+ kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="Evicted",uid="uid2"} 0
+ kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="OOMKilled",uid="uid2"} 1
+ kube_pod_container_status_terminated_reason{container="container2",namespace="ns2",pod="pod2",reason="DeadlineExceeded",uid="uid2"} 0
+ kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="Completed",uid="uid2"} 0
+ kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="ContainerCannotRun",uid="uid2"} 0
+ kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="Error",uid="uid2"} 0
+ kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="Evicted",uid="uid2"} 0
+ kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="OOMKilled",uid="uid2"} 0
+ kube_pod_container_status_terminated_reason{container="container3",namespace="ns2",pod="pod2",reason="DeadlineExceeded",uid="uid2"} 0
+ kube_pod_container_status_waiting{container="container2",namespace="ns2",pod="pod2",uid="uid2"} 0
+ kube_pod_container_status_waiting{container="container3",namespace="ns2",pod="pod2",uid="uid2"} 1
+ kube_pod_container_status_terminated{container="container3",namespace="ns2",pod="pod2",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="ContainerCreating",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="ImagePullBackOff",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="CrashLoopBackOff",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="ErrImagePull",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="CreateContainerConfigError",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="CreateContainerError",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container2",namespace="ns2",pod="pod2",reason="InvalidImageName",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="ContainerCreating",uid="uid2"} 1
+ kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="CrashLoopBackOff",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="ErrImagePull",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="ImagePullBackOff",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="CreateContainerConfigError",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="CreateContainerError",uid="uid2"} 0
+ kube_pod_container_status_waiting_reason{container="container3",namespace="ns2",pod="pod2",reason="InvalidImageName",uid="uid2"} 0
`,
MetricNames: []string{
"kube_pod_container_status_running",
@@ -465,6 +476,7 @@ func TestPodStore(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod3",
Namespace: "ns3",
+ UID: "uid3",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -492,28 +504,28 @@ func TestPodStore(t *testing.T) {
# TYPE kube_pod_container_status_terminated_reason gauge
# TYPE kube_pod_container_status_waiting gauge
# TYPE kube_pod_container_status_waiting_reason gauge
- kube_pod_container_status_running{container="container4",namespace="ns3",pod="pod3"} 0
- kube_pod_container_status_terminated{container="container4",namespace="ns3",pod="pod3"} 0
-kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Completed"} 0
- kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="ContainerCannotRun"} 0
- kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Error"} 0
- kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Evicted"} 0
- kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="OOMKilled"} 0
- kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="DeadlineExceeded"} 0
- kube_pod_container_status_waiting{container="container4",namespace="ns3",pod="pod3"} 1
-kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="ContainerCreating"} 0
- kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="ImagePullBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="CrashLoopBackOff"} 1
- kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="ErrImagePull"} 0
- kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="CreateContainerConfigError"} 0
- kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="CreateContainerError"} 0
- kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="InvalidImageName"} 0
-kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Completed"} 0
- kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="ContainerCannotRun"} 0
- kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Error"} 0
- kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Evicted"} 0
- kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="OOMKilled"} 0
- kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="DeadlineExceeded"} 0
+ kube_pod_container_status_running{container="container4",namespace="ns3",pod="pod3",uid="uid3"} 0
+ kube_pod_container_status_terminated{container="container4",namespace="ns3",pod="pod3",uid="uid3"} 0
+kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Completed",uid="uid3"} 0
+ kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="ContainerCannotRun",uid="uid3"} 0
+ kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Error",uid="uid3"} 0
+ kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Evicted",uid="uid3"} 0
+ kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="OOMKilled",uid="uid3"} 0
+ kube_pod_container_status_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="DeadlineExceeded",uid="uid3"} 0
+ kube_pod_container_status_waiting{container="container4",namespace="ns3",pod="pod3",uid="uid3"} 1
+kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="ContainerCreating",uid="uid3"} 0
+ kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="ImagePullBackOff",uid="uid3"} 0
+ kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="CrashLoopBackOff",uid="uid3"} 1
+ kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="ErrImagePull",uid="uid3"} 0
+ kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="CreateContainerConfigError",uid="uid3"} 0
+ kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="CreateContainerError",uid="uid3"} 0
+ kube_pod_container_status_waiting_reason{container="container4",namespace="ns3",pod="pod3",reason="InvalidImageName",uid="uid3"} 0
+kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Completed",uid="uid3"} 0
+ kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="ContainerCannotRun",uid="uid3"} 0
+ kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Error",uid="uid3"} 0
+ kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="Evicted",uid="uid3"} 0
+ kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="OOMKilled",uid="uid3"} 0
+ kube_pod_container_status_last_terminated_reason{container="container4",namespace="ns3",pod="pod3",reason="DeadlineExceeded",uid="uid3"} 0
`,
MetricNames: []string{
"kube_pod_container_status_running",
@@ -540,6 +552,7 @@ kube_pod_container_status_last_terminated_reason{container="container4",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod6",
Namespace: "ns6",
+ UID: "uid6",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -576,29 +589,29 @@ kube_pod_container_status_last_terminated_reason{container="container4",namespac
# TYPE kube_pod_container_status_waiting gauge
# TYPE kube_pod_container_status_waiting_reason gauge
# TYPE kube_pod_container_state_started gauge
- kube_pod_container_status_running{container="container7",namespace="ns6",pod="pod6"} 1
- kube_pod_container_state_started{container="container7",namespace="ns6",pod="pod6"} 1.501777018e+09
- kube_pod_container_status_terminated{container="container7",namespace="ns6",pod="pod6"} 0
-kube_pod_container_status_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Completed"} 0
- kube_pod_container_status_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="ContainerCannotRun"} 0
- kube_pod_container_status_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Error"} 0
- kube_pod_container_status_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Evicted"} 0
- kube_pod_container_status_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled"} 0
- kube_pod_container_status_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="DeadlineExceeded"} 0
- kube_pod_container_status_waiting{container="container7",namespace="ns6",pod="pod6"} 0
-kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="ContainerCreating"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="ImagePullBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="CrashLoopBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="ErrImagePull"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="CreateContainerConfigError"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="CreateContainerError"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="InvalidImageName"} 0
-kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Completed"} 0
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="ContainerCannotRun"} 0
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Error"} 0
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Evicted"} 0
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled"} 1
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="DeadlineExceeded"} 0
+ kube_pod_container_status_running{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 1
+ 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_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Completed",uid="uid6"} 0
+ kube_pod_container_status_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="ContainerCannotRun",uid="uid6"} 0
+ kube_pod_container_status_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Error",uid="uid6"} 0
+ kube_pod_container_status_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Evicted",uid="uid6"} 0
+ kube_pod_container_status_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="OOMKilled",uid="uid6"} 0
+ kube_pod_container_status_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="DeadlineExceeded",uid="uid6"} 0
+ kube_pod_container_status_waiting{container="container7",namespace="ns6",pod="pod6",uid="uid6"} 0
+kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="ContainerCreating",uid="uid6"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="ImagePullBackOff",uid="uid6"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="CrashLoopBackOff",uid="uid6"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="ErrImagePull",uid="uid6"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="CreateContainerConfigError",uid="uid6"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="CreateContainerError",uid="uid6"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns6",pod="pod6",reason="InvalidImageName",uid="uid6"} 0
+kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Completed",uid="uid6"} 0
+ kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="ContainerCannotRun",uid="uid6"} 0
+ kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Error",uid="uid6"} 0
+ kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns6",pod="pod6",reason="Evicted",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="DeadlineExceeded",uid="uid6"} 0
`,
MetricNames: []string{
"kube_pod_container_status_last_terminated_reason",
@@ -615,6 +628,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod7",
Namespace: "ns7",
+ UID: "uid7",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -651,29 +665,29 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# TYPE kube_pod_container_status_terminated_reason gauge
# TYPE kube_pod_container_status_waiting gauge
# TYPE kube_pod_container_status_waiting_reason gauge
- kube_pod_container_status_running{container="container7",namespace="ns7",pod="pod7"} 1
- kube_pod_container_state_started{container="container7",namespace="ns7",pod="pod7"} 1.501777018e+09
- kube_pod_container_status_terminated{container="container7",namespace="ns7",pod="pod7"} 0
-kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Completed"} 0
- kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="ContainerCannotRun"} 0
- kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Error"} 0
- kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Evicted"} 0
- kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="OOMKilled"} 0
- kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded"} 0
- kube_pod_container_status_waiting{container="container7",namespace="ns7",pod="pod7"} 0
-kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="ContainerCreating"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="ImagePullBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="CrashLoopBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="ErrImagePull"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="CreateContainerConfigError"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="CreateContainerError"} 0
- kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="InvalidImageName"} 0
-kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Completed"} 0
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="ContainerCannotRun"} 0
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Error"} 0
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Evicted"} 0
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="OOMKilled"} 0
- kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded"} 1
+ kube_pod_container_status_running{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 1
+ kube_pod_container_state_started{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 1.501777018e+09
+ kube_pod_container_status_terminated{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 0
+kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Completed",uid="uid7"} 0
+ kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="ContainerCannotRun",uid="uid7"} 0
+ kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Error",uid="uid7"} 0
+ kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Evicted",uid="uid7"} 0
+ kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="OOMKilled",uid="uid7"} 0
+ kube_pod_container_status_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7"} 0
+ kube_pod_container_status_waiting{container="container7",namespace="ns7",pod="pod7",uid="uid7"} 0
+kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="ContainerCreating",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="ImagePullBackOff",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="CrashLoopBackOff",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="ErrImagePull",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="CreateContainerConfigError",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="CreateContainerError",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container7",namespace="ns7",pod="pod7",reason="InvalidImageName",uid="uid7"} 0
+kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Completed",uid="uid7"} 0
+ kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="ContainerCannotRun",uid="uid7"} 0
+ kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Error",uid="uid7"} 0
+ kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="Evicted",uid="uid7"} 0
+ kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="OOMKilled",uid="uid7"} 0
+ kube_pod_container_status_last_terminated_reason{container="container7",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7"} 1
`,
MetricNames: []string{
"kube_pod_container_status_running",
@@ -690,6 +704,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod4",
Namespace: "ns4",
+ UID: "uid4",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -715,22 +730,22 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# TYPE kube_pod_container_status_terminated_reason gauge
# TYPE kube_pod_container_status_waiting gauge
# TYPE kube_pod_container_status_waiting_reason gauge
- kube_pod_container_status_running{container="container5",namespace="ns4",pod="pod4"} 0
- kube_pod_container_status_terminated{container="container5",namespace="ns4",pod="pod4"} 0
- kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="Completed"} 0
- kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="ContainerCannotRun"} 0
- kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="Error"} 0
- kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="Evicted"} 0
- kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="OOMKilled"} 0
- kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="DeadlineExceeded"} 0
- kube_pod_container_status_waiting{container="container5",namespace="ns4",pod="pod4"} 1
- kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="ContainerCreating"} 0
- kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="ImagePullBackOff"} 1
- kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="CrashLoopBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="ErrImagePull"} 0
- kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="CreateContainerConfigError"} 0
- kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="CreateContainerError"} 0
- kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="InvalidImageName"} 0
+ kube_pod_container_status_running{container="container5",namespace="ns4",pod="pod4",uid="uid4"} 0
+ kube_pod_container_status_terminated{container="container5",namespace="ns4",pod="pod4",uid="uid4"} 0
+ kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="Completed",uid="uid4"} 0
+ kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="ContainerCannotRun",uid="uid4"} 0
+ kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="Error",uid="uid4"} 0
+ kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="Evicted",uid="uid4"} 0
+ kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="OOMKilled",uid="uid4"} 0
+ kube_pod_container_status_terminated_reason{container="container5",namespace="ns4",pod="pod4",reason="DeadlineExceeded",uid="uid4"} 0
+ kube_pod_container_status_waiting{container="container5",namespace="ns4",pod="pod4",uid="uid4"} 1
+ kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="ContainerCreating",uid="uid4"} 0
+ kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="ImagePullBackOff",uid="uid4"} 1
+ kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="CrashLoopBackOff",uid="uid4"} 0
+ kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="ErrImagePull",uid="uid4"} 0
+ kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="CreateContainerConfigError",uid="uid4"} 0
+ kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="CreateContainerError",uid="uid4"} 0
+ kube_pod_container_status_waiting_reason{container="container5",namespace="ns4",pod="pod4",reason="InvalidImageName",uid="uid4"} 0
`,
MetricNames: []string{
"kube_pod_container_status_running",
@@ -745,6 +760,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod5",
Namespace: "ns5",
+ UID: "uid5",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -770,22 +786,22 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# TYPE kube_pod_container_status_terminated_reason gauge
# TYPE kube_pod_container_status_waiting gauge
# TYPE kube_pod_container_status_waiting_reason gauge
- kube_pod_container_status_running{container="container6",namespace="ns5",pod="pod5"} 0
- kube_pod_container_status_terminated{container="container6",namespace="ns5",pod="pod5"} 0
- kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="Completed"} 0
- kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="ContainerCannotRun"} 0
- kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="Error"} 0
- kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="Evicted"} 0
- kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="OOMKilled"} 0
- kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="DeadlineExceeded"} 0
- kube_pod_container_status_waiting{container="container6",namespace="ns5",pod="pod5"} 1
- kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="ContainerCreating"} 0
- kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="ImagePullBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="CrashLoopBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="ErrImagePull"} 1
- kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="CreateContainerConfigError"} 0
- kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="CreateContainerError"} 0
- kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="InvalidImageName"} 0
+ kube_pod_container_status_running{container="container6",namespace="ns5",pod="pod5",uid="uid5"} 0
+ kube_pod_container_status_terminated{container="container6",namespace="ns5",pod="pod5",uid="uid5"} 0
+ kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="Completed",uid="uid5"} 0
+ kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="ContainerCannotRun",uid="uid5"} 0
+ kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="Error",uid="uid5"} 0
+ kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="Evicted",uid="uid5"} 0
+ kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="OOMKilled",uid="uid5"} 0
+ kube_pod_container_status_terminated_reason{container="container6",namespace="ns5",pod="pod5",reason="DeadlineExceeded",uid="uid5"} 0
+ kube_pod_container_status_waiting{container="container6",namespace="ns5",pod="pod5",uid="uid5"} 1
+ kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="ContainerCreating",uid="uid5"} 0
+ kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="ImagePullBackOff",uid="uid5"} 0
+ kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="CrashLoopBackOff",uid="uid5"} 0
+ kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="ErrImagePull",uid="uid5"} 1
+ kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="CreateContainerConfigError",uid="uid5"} 0
+ kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="CreateContainerError",uid="uid5"} 0
+ kube_pod_container_status_waiting_reason{container="container6",namespace="ns5",pod="pod5",reason="InvalidImageName",uid="uid5"} 0
`,
MetricNames: []string{
"kube_pod_container_status_running",
@@ -800,6 +816,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod7",
Namespace: "ns7",
+ UID: "uid7",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
@@ -825,22 +842,22 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# TYPE kube_pod_container_status_terminated_reason gauge
# TYPE kube_pod_container_status_waiting gauge
# TYPE kube_pod_container_status_waiting_reason gauge
- kube_pod_container_status_running{container="container8",namespace="ns7",pod="pod7"} 0
- kube_pod_container_status_terminated{container="container8",namespace="ns7",pod="pod7"} 0
- kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="Completed"} 0
- kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="ContainerCannotRun"} 0
- kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="Error"} 0
- kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="Evicted"} 0
- kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="OOMKilled"} 0
- kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="DeadlineExceeded"} 0
- kube_pod_container_status_waiting{container="container8",namespace="ns7",pod="pod7"} 1
- kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="ContainerCreating"} 0
- kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="ImagePullBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="CrashLoopBackOff"} 0
- kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="ErrImagePull"} 0
- kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="CreateContainerError"} 0
- kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="InvalidImageName"} 0
- kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="CreateContainerConfigError"} 1
+ kube_pod_container_status_running{container="container8",namespace="ns7",pod="pod7",uid="uid7"} 0
+ kube_pod_container_status_terminated{container="container8",namespace="ns7",pod="pod7",uid="uid7"} 0
+ kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="Completed",uid="uid7"} 0
+ kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="ContainerCannotRun",uid="uid7"} 0
+ kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="Error",uid="uid7"} 0
+ kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="Evicted",uid="uid7"} 0
+ kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="OOMKilled",uid="uid7"} 0
+ kube_pod_container_status_terminated_reason{container="container8",namespace="ns7",pod="pod7",reason="DeadlineExceeded",uid="uid7"} 0
+ kube_pod_container_status_waiting{container="container8",namespace="ns7",pod="pod7",uid="uid7"} 1
+ kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="ContainerCreating",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="ImagePullBackOff",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="CrashLoopBackOff",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="ErrImagePull",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="CreateContainerError",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="InvalidImageName",uid="uid7"} 0
+ kube_pod_container_status_waiting_reason{container="container8",namespace="ns7",pod="pod7",reason="CreateContainerConfigError",uid="uid7"} 1
`,
MetricNames: []string{
"kube_pod_container_status_running",
@@ -882,10 +899,10 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# TYPE kube_pod_info gauge
# TYPE kube_pod_owner gauge
# TYPE kube_pod_start_time gauge
- kube_pod_created{namespace="ns1",pod="pod1"} 1.5e+09
+ kube_pod_created{namespace="ns1",pod="pod1",uid="abc-123-xxx"} 1.5e+09
kube_pod_info{created_by_kind="",created_by_name="",host_ip="1.1.1.1",namespace="ns1",node="node1",pod="pod1",pod_ip="1.2.3.4",uid="abc-123-xxx",priority_class="system-node-critical",host_network="true"} 1
- kube_pod_start_time{namespace="ns1",pod="pod1"} 1.501569018e+09
- kube_pod_owner{namespace="ns1",owner_is_controller="",owner_kind="",owner_name="",pod="pod1"} 1
+ kube_pod_start_time{namespace="ns1",pod="pod1",uid="abc-123-xxx"} 1.501569018e+09
+ kube_pod_owner{namespace="ns1",owner_is_controller="",owner_kind="",owner_name="",pod="pod1",uid="abc-123-xxx"} 1
`,
MetricNames: []string{"kube_pod_created", "kube_pod_info", "kube_pod_start_time", "kube_pod_completion_time", "kube_pod_owner"},
},
@@ -911,7 +928,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_deletion_timestamp Unix deletion timestamp
# TYPE kube_pod_deletion_timestamp gauge
- kube_pod_deletion_timestamp{namespace="ns1",pod="pod1"} 1.8e+09
+ kube_pod_deletion_timestamp{namespace="ns1",pod="pod1",uid="abc-123-xxx"} 1.8e+09
`,
MetricNames: []string{"kube_pod_deletion_timestamp"},
},
@@ -920,6 +937,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Spec: v1.PodSpec{
RestartPolicy: v1.RestartPolicyAlways,
@@ -928,7 +946,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_restart_policy Describes the restart policy in use by this pod.
# TYPE kube_pod_restart_policy gauge
- kube_pod_restart_policy{namespace="ns2",pod="pod2",type="Always"} 1
+ kube_pod_restart_policy{namespace="ns2",pod="pod2",type="Always",uid="uid2"} 1
`,
MetricNames: []string{"kube_pod_restart_policy"},
},
@@ -937,6 +955,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Spec: v1.PodSpec{
RestartPolicy: v1.RestartPolicyOnFailure,
@@ -945,7 +964,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_restart_policy Describes the restart policy in use by this pod.
# TYPE kube_pod_restart_policy gauge
- kube_pod_restart_policy{namespace="ns2",pod="pod2",type="OnFailure"} 1
+ kube_pod_restart_policy{namespace="ns2",pod="pod2",type="OnFailure",uid="uid2"} 1
`,
MetricNames: []string{"kube_pod_restart_policy"},
},
@@ -1024,8 +1043,8 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# TYPE kube_pod_owner gauge
# TYPE kube_pod_start_time gauge
kube_pod_info{created_by_kind="ReplicaSet",created_by_name="rs-name",host_ip="1.1.1.1",namespace="ns2",node="node2",pod="pod2",pod_ip="2.3.4.5",uid="abc-456-xxx",priority_class="",host_network="false"} 1
- kube_pod_completion_time{namespace="ns2",pod="pod2"} 1.501888018e+09
- kube_pod_owner{namespace="ns2",owner_is_controller="true",owner_kind="ReplicaSet",owner_name="rs-name",pod="pod2"} 1
+ kube_pod_completion_time{namespace="ns2",pod="pod2",uid="abc-456-xxx"} 1.501888018e+09
+ kube_pod_owner{namespace="ns2",owner_is_controller="true",owner_kind="ReplicaSet",owner_name="rs-name",pod="pod2",uid="abc-456-xxx"} 1
`,
MetricNames: []string{"kube_pod_created", "kube_pod_info", "kube_pod_start_time", "kube_pod_completion_time", "kube_pod_owner"},
},
@@ -1034,6 +1053,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
},
Status: v1.PodStatus{
Phase: v1.PodRunning,
@@ -1042,11 +1062,11 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_status_phase The pods current phase.
# TYPE kube_pod_status_phase gauge
- kube_pod_status_phase{namespace="ns1",phase="Failed",pod="pod1"} 0
- kube_pod_status_phase{namespace="ns1",phase="Pending",pod="pod1"} 0
- kube_pod_status_phase{namespace="ns1",phase="Running",pod="pod1"} 1
- kube_pod_status_phase{namespace="ns1",phase="Succeeded",pod="pod1"} 0
- kube_pod_status_phase{namespace="ns1",phase="Unknown",pod="pod1"} 0
+ kube_pod_status_phase{namespace="ns1",phase="Failed",pod="pod1",uid="uid1"} 0
+ kube_pod_status_phase{namespace="ns1",phase="Pending",pod="pod1",uid="uid1"} 0
+ kube_pod_status_phase{namespace="ns1",phase="Running",pod="pod1",uid="uid1"} 1
+ kube_pod_status_phase{namespace="ns1",phase="Succeeded",pod="pod1",uid="uid1"} 0
+ kube_pod_status_phase{namespace="ns1",phase="Unknown",pod="pod1",uid="uid1"} 0
`,
MetricNames: []string{"kube_pod_status_phase"},
},
@@ -1055,6 +1075,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Status: v1.PodStatus{
Phase: v1.PodPending,
@@ -1063,11 +1084,11 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_status_phase The pods current phase.
# TYPE kube_pod_status_phase gauge
- kube_pod_status_phase{namespace="ns2",phase="Failed",pod="pod2"} 0
- kube_pod_status_phase{namespace="ns2",phase="Pending",pod="pod2"} 1
- kube_pod_status_phase{namespace="ns2",phase="Running",pod="pod2"} 0
- kube_pod_status_phase{namespace="ns2",phase="Succeeded",pod="pod2"} 0
- kube_pod_status_phase{namespace="ns2",phase="Unknown",pod="pod2"} 0
+ kube_pod_status_phase{namespace="ns2",phase="Failed",pod="pod2",uid="uid2"} 0
+ kube_pod_status_phase{namespace="ns2",phase="Pending",pod="pod2",uid="uid2"} 1
+ kube_pod_status_phase{namespace="ns2",phase="Running",pod="pod2",uid="uid2"} 0
+ kube_pod_status_phase{namespace="ns2",phase="Succeeded",pod="pod2",uid="uid2"} 0
+ kube_pod_status_phase{namespace="ns2",phase="Unknown",pod="pod2",uid="uid2"} 0
`,
MetricNames: []string{"kube_pod_status_phase"},
},
@@ -1077,6 +1098,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod3",
Namespace: "ns3",
+ UID: "uid3",
},
Status: v1.PodStatus{
Phase: v1.PodUnknown,
@@ -1085,11 +1107,11 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_status_phase The pods current phase.
# TYPE kube_pod_status_phase gauge
- kube_pod_status_phase{namespace="ns3",phase="Failed",pod="pod3"} 0
- kube_pod_status_phase{namespace="ns3",phase="Pending",pod="pod3"} 0
- kube_pod_status_phase{namespace="ns3",phase="Running",pod="pod3"} 0
- kube_pod_status_phase{namespace="ns3",phase="Succeeded",pod="pod3"} 0
- kube_pod_status_phase{namespace="ns3",phase="Unknown",pod="pod3"} 1
+ kube_pod_status_phase{namespace="ns3",phase="Failed",pod="pod3",uid="uid3"} 0
+ kube_pod_status_phase{namespace="ns3",phase="Pending",pod="pod3",uid="uid3"} 0
+ kube_pod_status_phase{namespace="ns3",phase="Running",pod="pod3",uid="uid3"} 0
+ kube_pod_status_phase{namespace="ns3",phase="Succeeded",pod="pod3",uid="uid3"} 0
+ kube_pod_status_phase{namespace="ns3",phase="Unknown",pod="pod3",uid="uid3"} 1
`,
MetricNames: []string{"kube_pod_status_phase"},
},
@@ -1098,6 +1120,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod4",
Namespace: "ns4",
+ UID: "uid4",
DeletionTimestamp: &metav1.Time{},
},
Status: v1.PodStatus{
@@ -1110,14 +1133,14 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# HELP kube_pod_status_reason The pod status reasons
# TYPE kube_pod_status_phase gauge
# TYPE kube_pod_status_reason gauge
- kube_pod_status_phase{namespace="ns4",phase="Failed",pod="pod4"} 0
- kube_pod_status_phase{namespace="ns4",phase="Pending",pod="pod4"} 0
- kube_pod_status_phase{namespace="ns4",phase="Running",pod="pod4"} 1
- kube_pod_status_phase{namespace="ns4",phase="Succeeded",pod="pod4"} 0
- kube_pod_status_phase{namespace="ns4",phase="Unknown",pod="pod4"} 0
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="Evicted"} 0
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="NodeLost"} 1
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="UnexpectedAdmissionError"} 0
+ kube_pod_status_phase{namespace="ns4",phase="Failed",pod="pod4",uid="uid4"} 0
+ kube_pod_status_phase{namespace="ns4",phase="Pending",pod="pod4",uid="uid4"} 0
+ kube_pod_status_phase{namespace="ns4",phase="Running",pod="pod4",uid="uid4"} 1
+ kube_pod_status_phase{namespace="ns4",phase="Succeeded",pod="pod4",uid="uid4"} 0
+ kube_pod_status_phase{namespace="ns4",phase="Unknown",pod="pod4",uid="uid4"} 0
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="Evicted",uid="uid4"} 0
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="NodeLost",uid="uid4"} 1
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="UnexpectedAdmissionError",uid="uid4"} 0
`,
MetricNames: []string{"kube_pod_status_phase", "kube_pod_status_reason"},
},
@@ -1126,6 +1149,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod4",
Namespace: "ns4",
+ UID: "uid4",
DeletionTimestamp: &metav1.Time{},
},
Status: v1.PodStatus{
@@ -1136,9 +1160,9 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_status_reason The pod status reasons
# TYPE kube_pod_status_reason gauge
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="Evicted"} 1
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="NodeLost"} 0
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="UnexpectedAdmissionError"} 0
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="Evicted",uid="uid4"} 1
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="NodeLost",uid="uid4"} 0
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="UnexpectedAdmissionError",uid="uid4"} 0
`,
MetricNames: []string{"kube_pod_status_reason"},
},
@@ -1147,6 +1171,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod4",
Namespace: "ns4",
+ UID: "uid4",
DeletionTimestamp: &metav1.Time{},
},
Status: v1.PodStatus{
@@ -1157,9 +1182,9 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_status_reason The pod status reasons
# TYPE kube_pod_status_reason gauge
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="Evicted"} 0
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="NodeLost"} 0
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="UnexpectedAdmissionError"} 1
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="Evicted",uid="uid4"} 0
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="NodeLost",uid="uid4"} 0
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="UnexpectedAdmissionError",uid="uid4"} 1
`,
MetricNames: []string{"kube_pod_status_reason"},
},
@@ -1168,6 +1193,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod4",
Namespace: "ns4",
+ UID: "uid4",
DeletionTimestamp: &metav1.Time{},
},
Status: v1.PodStatus{
@@ -1178,9 +1204,9 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_status_reason The pod status reasons
# TYPE kube_pod_status_reason gauge
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="Evicted"} 0
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="NodeLost"} 0
- kube_pod_status_reason{namespace="ns4",pod="pod4",reason="UnexpectedAdmissionError"} 0
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="Evicted",uid="uid4"} 0
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="NodeLost",uid="uid4"} 0
+ kube_pod_status_reason{namespace="ns4",pod="pod4",reason="UnexpectedAdmissionError",uid="uid4"} 0
`,
MetricNames: []string{"kube_pod_status_reason"},
},
@@ -1189,6 +1215,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
},
Status: v1.PodStatus{
Conditions: []v1.PodCondition{
@@ -1202,9 +1229,9 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_status_ready Describes whether the pod is ready to serve requests.
# TYPE kube_pod_status_ready gauge
- kube_pod_status_ready{condition="false",namespace="ns1",pod="pod1"} 0
- kube_pod_status_ready{condition="true",namespace="ns1",pod="pod1"} 1
- kube_pod_status_ready{condition="unknown",namespace="ns1",pod="pod1"} 0
+ kube_pod_status_ready{condition="false",namespace="ns1",pod="pod1",uid="uid1"} 0
+ kube_pod_status_ready{condition="true",namespace="ns1",pod="pod1",uid="uid1"} 1
+ kube_pod_status_ready{condition="unknown",namespace="ns1",pod="pod1",uid="uid1"} 0
`,
MetricNames: []string{"kube_pod_status_ready"},
},
@@ -1213,6 +1240,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Status: v1.PodStatus{
Conditions: []v1.PodCondition{
@@ -1226,9 +1254,9 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_status_ready Describes whether the pod is ready to serve requests.
# TYPE kube_pod_status_ready gauge
- kube_pod_status_ready{condition="false",namespace="ns2",pod="pod2"} 1
- kube_pod_status_ready{condition="true",namespace="ns2",pod="pod2"} 0
- kube_pod_status_ready{condition="unknown",namespace="ns2",pod="pod2"} 0
+ kube_pod_status_ready{condition="false",namespace="ns2",pod="pod2",uid="uid2"} 1
+ kube_pod_status_ready{condition="true",namespace="ns2",pod="pod2",uid="uid2"} 0
+ kube_pod_status_ready{condition="unknown",namespace="ns2",pod="pod2",uid="uid2"} 0
`,
MetricNames: []string{"kube_pod_status_ready"},
},
@@ -1237,6 +1265,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
},
Status: v1.PodStatus{
Conditions: []v1.PodCondition{
@@ -1255,10 +1284,10 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# HELP kube_pod_status_scheduled_time Unix timestamp when pod moved into scheduled status
# TYPE kube_pod_status_scheduled gauge
# TYPE kube_pod_status_scheduled_time gauge
- kube_pod_status_scheduled_time{namespace="ns1",pod="pod1"} 1.501666018e+09
- kube_pod_status_scheduled{condition="false",namespace="ns1",pod="pod1"} 0
- kube_pod_status_scheduled{condition="true",namespace="ns1",pod="pod1"} 1
- kube_pod_status_scheduled{condition="unknown",namespace="ns1",pod="pod1"} 0
+ kube_pod_status_scheduled_time{namespace="ns1",pod="pod1",uid="uid1"} 1.501666018e+09
+ kube_pod_status_scheduled{condition="false",namespace="ns1",pod="pod1",uid="uid1"} 0
+ kube_pod_status_scheduled{condition="true",namespace="ns1",pod="pod1",uid="uid1"} 1
+ kube_pod_status_scheduled{condition="unknown",namespace="ns1",pod="pod1",uid="uid1"} 0
`,
MetricNames: []string{"kube_pod_status_scheduled", "kube_pod_status_scheduled_time"},
},
@@ -1267,6 +1296,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Status: v1.PodStatus{
Conditions: []v1.PodCondition{
@@ -1282,9 +1312,9 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# HELP kube_pod_status_scheduled_time Unix timestamp when pod moved into scheduled status
# TYPE kube_pod_status_scheduled gauge
# TYPE kube_pod_status_scheduled_time gauge
- kube_pod_status_scheduled{condition="false",namespace="ns2",pod="pod2"} 1
- kube_pod_status_scheduled{condition="true",namespace="ns2",pod="pod2"} 0
- kube_pod_status_scheduled{condition="unknown",namespace="ns2",pod="pod2"} 0
+ kube_pod_status_scheduled{condition="false",namespace="ns2",pod="pod2",uid="uid2"} 1
+ kube_pod_status_scheduled{condition="true",namespace="ns2",pod="pod2",uid="uid2"} 0
+ kube_pod_status_scheduled{condition="unknown",namespace="ns2",pod="pod2",uid="uid2"} 0
`,
MetricNames: []string{"kube_pod_status_scheduled", "kube_pod_status_scheduled_time"},
},
@@ -1293,6 +1323,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Status: v1.PodStatus{
Conditions: []v1.PodCondition{
@@ -1308,7 +1339,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_status_unschedulable Describes the unschedulable status for the pod.
# TYPE kube_pod_status_unschedulable gauge
- kube_pod_status_unschedulable{namespace="ns2",pod="pod2"} 1
+ kube_pod_status_unschedulable{namespace="ns2",pod="pod2",uid="uid2"} 1
`,
MetricNames: []string{"kube_pod_status_unschedulable"},
},
@@ -1317,6 +1348,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
},
Spec: v1.PodSpec{
Containers: []v1.Container{
@@ -1403,30 +1435,30 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# TYPE kube_pod_init_container_resource_requests_memory_bytes gauge
# TYPE kube_pod_init_container_resource_requests_storage_bytes gauge
# TYPE kube_pod_init_container_status_last_terminated_reason gauge
- kube_pod_container_resource_limits{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="cpu",unit="core"} 0.2
- kube_pod_container_resource_limits{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="ephemeral_storage",unit="byte"} 3e+08
- kube_pod_container_resource_limits{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="memory",unit="byte"} 1e+08
- kube_pod_container_resource_limits{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="nvidia_com_gpu",unit="integer"} 1
- kube_pod_container_resource_limits{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="storage",unit="byte"} 4e+08
- kube_pod_container_resource_limits{container="pod1_con2",namespace="ns1",node="",pod="pod1",resource="cpu",unit="core"} 0.3
- kube_pod_container_resource_limits{container="pod1_con2",namespace="ns1",node="",pod="pod1",resource="memory",unit="byte"} 2e+08
- kube_pod_container_resource_requests{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="cpu",unit="core"} 0.2
- kube_pod_container_resource_requests{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="ephemeral_storage",unit="byte"} 3e+08
- kube_pod_container_resource_requests{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="memory",unit="byte"} 1e+08
- kube_pod_container_resource_requests{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="nvidia_com_gpu",unit="integer"} 1
- kube_pod_container_resource_requests{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="storage",unit="byte"} 4e+08
- kube_pod_container_resource_requests{container="pod1_con2",namespace="ns1",node="",pod="pod1",resource="cpu",unit="core"} 0.3
- kube_pod_container_resource_requests{container="pod1_con2",namespace="ns1",node="",pod="pod1",resource="memory",unit="byte"} 2e+08
- kube_pod_init_container_resource_limits_cpu_cores{container="pod1_initcon1",namespace="ns1",pod="pod1"} 0.2
- kube_pod_init_container_resource_limits_ephemeral_storage_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1"} 3e+08
- kube_pod_init_container_resource_limits_memory_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1"} 1e+08
- kube_pod_init_container_resource_limits_storage_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1"} 4e+08
- kube_pod_init_container_resource_limits{container="pod1_initcon1",namespace="ns1",pod="pod1",resource="nvidia_com_gpu",unit="integer"} 1
- kube_pod_init_container_resource_requests_cpu_cores{container="pod1_initcon1",namespace="ns1",pod="pod1"} 0.2
- kube_pod_init_container_resource_requests_ephemeral_storage_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1"} 3e+08
- kube_pod_init_container_resource_requests_memory_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1"} 1e+08
- kube_pod_init_container_resource_requests_storage_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1"} 4e+08
- kube_pod_init_container_resource_requests{container="pod1_initcon1",namespace="ns1",pod="pod1",resource="nvidia_com_gpu",unit="integer"} 1
+ kube_pod_container_resource_limits{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="cpu",unit="core",uid="uid1"} 0.2
+ kube_pod_container_resource_limits{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="ephemeral_storage",unit="byte",uid="uid1"} 3e+08
+ kube_pod_container_resource_limits{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="memory",unit="byte",uid="uid1"} 1e+08
+ kube_pod_container_resource_limits{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="nvidia_com_gpu",unit="integer",uid="uid1"} 1
+ kube_pod_container_resource_limits{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="storage",unit="byte",uid="uid1"} 4e+08
+ kube_pod_container_resource_limits{container="pod1_con2",namespace="ns1",node="",pod="pod1",resource="cpu",unit="core",uid="uid1"} 0.3
+ kube_pod_container_resource_limits{container="pod1_con2",namespace="ns1",node="",pod="pod1",resource="memory",unit="byte",uid="uid1"} 2e+08
+ kube_pod_container_resource_requests{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="cpu",unit="core",uid="uid1"} 0.2
+ kube_pod_container_resource_requests{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="ephemeral_storage",unit="byte",uid="uid1"} 3e+08
+ kube_pod_container_resource_requests{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="memory",unit="byte",uid="uid1"} 1e+08
+ kube_pod_container_resource_requests{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="nvidia_com_gpu",unit="integer",uid="uid1"} 1
+ kube_pod_container_resource_requests{container="pod1_con1",namespace="ns1",node="",pod="pod1",resource="storage",unit="byte",uid="uid1"} 4e+08
+ kube_pod_container_resource_requests{container="pod1_con2",namespace="ns1",node="",pod="pod1",resource="cpu",unit="core",uid="uid1"} 0.3
+ kube_pod_container_resource_requests{container="pod1_con2",namespace="ns1",node="",pod="pod1",resource="memory",unit="byte",uid="uid1"} 2e+08
+ kube_pod_init_container_resource_limits_cpu_cores{container="pod1_initcon1",namespace="ns1",pod="pod1",uid="uid1"} 0.2
+ kube_pod_init_container_resource_limits_ephemeral_storage_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1",uid="uid1"} 3e+08
+ kube_pod_init_container_resource_limits_memory_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1",uid="uid1"} 1e+08
+ kube_pod_init_container_resource_limits_storage_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1",uid="uid1"} 4e+08
+ kube_pod_init_container_resource_limits{container="pod1_initcon1",namespace="ns1",pod="pod1",resource="nvidia_com_gpu",unit="integer",uid="uid1"} 1
+ kube_pod_init_container_resource_requests_cpu_cores{container="pod1_initcon1",namespace="ns1",pod="pod1",uid="uid1"} 0.2
+ kube_pod_init_container_resource_requests_ephemeral_storage_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1",uid="uid1"} 3e+08
+ kube_pod_init_container_resource_requests_memory_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1",uid="uid1"} 1e+08
+ kube_pod_init_container_resource_requests_storage_bytes{container="pod1_initcon1",namespace="ns1",pod="pod1",uid="uid1"} 4e+08
+ kube_pod_init_container_resource_requests{container="pod1_initcon1",namespace="ns1",pod="pod1",resource="nvidia_com_gpu",unit="integer",uid="uid1"} 1
`,
MetricNames: []string{
"kube_pod_container_resource_requests",
@@ -1442,6 +1474,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod2",
Namespace: "ns2",
+ UID: "uid2",
},
Spec: v1.PodSpec{
Containers: []v1.Container{
@@ -1498,8 +1531,8 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# HELP kube_pod_init_container_resource_limits_memory_bytes Bytes of memory requested limit by an init container.
# TYPE kube_pod_init_container_resource_limits_cpu_cores gauge
# TYPE kube_pod_init_container_resource_limits_memory_bytes gauge
- kube_pod_init_container_resource_limits_cpu_cores{container="pod2_initcon1",namespace="ns2",pod="pod2"} 0.4
- kube_pod_init_container_resource_limits_memory_bytes{container="pod2_initcon1",namespace="ns2",pod="pod2"} 3e+08
+ kube_pod_init_container_resource_limits_cpu_cores{container="pod2_initcon1",namespace="ns2",pod="pod2",uid="uid2"} 0.4
+ kube_pod_init_container_resource_limits_memory_bytes{container="pod2_initcon1",namespace="ns2",pod="pod2",uid="uid2"} 3e+08
`,
MetricNames: []string{
"kube_pod_init_container_resource_limits_cpu_cores",
@@ -1511,6 +1544,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
Labels: map[string]string{
"app": "example",
},
@@ -1520,7 +1554,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_labels Kubernetes labels converted to Prometheus labels.
# TYPE kube_pod_labels gauge
- kube_pod_labels{label_app="example",namespace="ns1",pod="pod1"} 1
+ kube_pod_labels{label_app="example",namespace="ns1",pod="pod1",uid="uid1"} 1
`,
MetricNames: []string{
"kube_pod_labels",
@@ -1531,6 +1565,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
Labels: map[string]string{
"app": "example",
},
@@ -1571,10 +1606,10 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
# HELP kube_pod_spec_volumes_persistentvolumeclaims_readonly Describes whether a persistentvolumeclaim is mounted read only.
# TYPE kube_pod_spec_volumes_persistentvolumeclaims_info gauge
# TYPE kube_pod_spec_volumes_persistentvolumeclaims_readonly gauge
- kube_pod_spec_volumes_persistentvolumeclaims_info{namespace="ns1",persistentvolumeclaim="claim1",pod="pod1",volume="myvol"} 1
- kube_pod_spec_volumes_persistentvolumeclaims_info{namespace="ns1",persistentvolumeclaim="claim2",pod="pod1",volume="my-readonly-vol"} 1
- kube_pod_spec_volumes_persistentvolumeclaims_readonly{namespace="ns1",persistentvolumeclaim="claim1",pod="pod1",volume="myvol"} 0
- kube_pod_spec_volumes_persistentvolumeclaims_readonly{namespace="ns1",persistentvolumeclaim="claim2",pod="pod1",volume="my-readonly-vol"} 1
+ kube_pod_spec_volumes_persistentvolumeclaims_info{namespace="ns1",persistentvolumeclaim="claim1",pod="pod1",volume="myvol",uid="uid1"} 1
+ kube_pod_spec_volumes_persistentvolumeclaims_info{namespace="ns1",persistentvolumeclaim="claim2",pod="pod1",volume="my-readonly-vol",uid="uid1"} 1
+ kube_pod_spec_volumes_persistentvolumeclaims_readonly{namespace="ns1",persistentvolumeclaim="claim1",pod="pod1",volume="myvol",uid="uid1"} 0
+ kube_pod_spec_volumes_persistentvolumeclaims_readonly{namespace="ns1",persistentvolumeclaim="claim2",pod="pod1",volume="my-readonly-vol",uid="uid1"} 1
`,
MetricNames: []string{
@@ -1587,6 +1622,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
Labels: map[string]string{
"app": "example",
},
@@ -1598,7 +1634,7 @@ kube_pod_container_status_last_terminated_reason{container="container7",namespac
Want: `
# HELP kube_pod_runtimeclass_name_info The runtimeclass associated with the pod.
# TYPE kube_pod_runtimeclass_name_info gauge
- kube_pod_runtimeclass_name_info{namespace="ns1",pod="pod1",runtimeclass_name="foo"} 1
+ kube_pod_runtimeclass_name_info{namespace="ns1",pod="pod1",runtimeclass_name="foo",uid="uid1"} 1
`,
MetricNames: []string{
"kube_pod_runtimeclass_name_info",
@@ -1624,6 +1660,7 @@ func BenchmarkPodStore(b *testing.B) {
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns1",
+ UID: "uid1",
},
Status: v1.PodStatus{
ContainerStatuses: []v1.ContainerStatus{
diff --git a/main_test.go b/main_test.go
index 3d74e9666d..2a54996ab7 100644
--- a/main_test.go
+++ b/main_test.go
@@ -143,6 +143,7 @@ func TestFullScrapeCycle(t *testing.T) {
"kube_pod_labels": {
"namespace",
"pod",
+ "uid",
},
})
@@ -264,83 +265,83 @@ func TestFullScrapeCycle(t *testing.T) {
# TYPE kube_pod_status_scheduled gauge
# TYPE kube_pod_status_scheduled_time gauge
# TYPE kube_pod_status_unschedulable gauge
-kube_pod_container_info{namespace="default",pod="pod0",container="container2",image="k8s.gcr.io/hyperkube2",image_id="docker://sha256:bbb",container_id="docker://cd456"} 1
-kube_pod_container_info{namespace="default",pod="pod0",container="container3",image="k8s.gcr.io/hyperkube3",image_id="docker://sha256:ccc",container_id="docker://ef789"} 1
-kube_pod_container_resource_limits{namespace="default",pod="pod0",container="pod1_con1",node="node1",resource="cpu",unit="core"} 0.2
-kube_pod_container_resource_limits{namespace="default",pod="pod0",container="pod1_con1",node="node1",resource="ephemeral_storage",unit="byte"} 3e+08
-kube_pod_container_resource_limits{namespace="default",pod="pod0",container="pod1_con1",node="node1",resource="memory",unit="byte"} 1e+08
-kube_pod_container_resource_limits{namespace="default",pod="pod0",container="pod1_con1",node="node1",resource="nvidia_com_gpu",unit="integer"} 1
-kube_pod_container_resource_limits{namespace="default",pod="pod0",container="pod1_con1",node="node1",resource="storage",unit="byte"} 4e+08
-kube_pod_container_resource_limits{namespace="default",pod="pod0",container="pod1_con2",node="node1",resource="cpu",unit="core"} 0.3
-kube_pod_container_resource_limits{namespace="default",pod="pod0",container="pod1_con2",node="node1",resource="memory",unit="byte"} 2e+08
-kube_pod_container_resource_requests{namespace="default",pod="pod0",container="pod1_con1",node="node1",resource="cpu",unit="core"} 0.2
-kube_pod_container_resource_requests{namespace="default",pod="pod0",container="pod1_con1",node="node1",resource="ephemeral_storage",unit="byte"} 3e+08
-kube_pod_container_resource_requests{namespace="default",pod="pod0",container="pod1_con1",node="node1",resource="memory",unit="byte"} 1e+08
-kube_pod_container_resource_requests{namespace="default",pod="pod0",container="pod1_con1",node="node1",resource="nvidia_com_gpu",unit="integer"} 1
-kube_pod_container_resource_requests{namespace="default",pod="pod0",container="pod1_con1",node="node1",resource="storage",unit="byte"} 4e+08
-kube_pod_container_resource_requests{namespace="default",pod="pod0",container="pod1_con2",node="node1",resource="cpu",unit="core"} 0.3
-kube_pod_container_resource_requests{namespace="default",pod="pod0",container="pod1_con2",node="node1",resource="memory",unit="byte"} 2e+08
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container2",reason="Completed"} 0
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container2",reason="ContainerCannotRun"} 0
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container2",reason="DeadlineExceeded"} 0
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container2",reason="Error"} 0
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container2",reason="Evicted"} 0
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container2",reason="OOMKilled"} 1
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container3",reason="Completed"} 0
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container3",reason="ContainerCannotRun"} 0
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container3",reason="DeadlineExceeded"} 0
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container3",reason="Error"} 0
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container3",reason="Evicted"} 0
-kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",container="container3",reason="OOMKilled"} 0
-kube_pod_container_status_ready{namespace="default",pod="pod0",container="container2"} 0
-kube_pod_container_status_ready{namespace="default",pod="pod0",container="container3"} 0
-kube_pod_container_status_restarts_total{namespace="default",pod="pod0",container="container2"} 0
-kube_pod_container_status_restarts_total{namespace="default",pod="pod0",container="container3"} 0
-kube_pod_container_status_running{namespace="default",pod="pod0",container="container2"} 0
-kube_pod_container_status_running{namespace="default",pod="pod0",container="container3"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container2",reason="Completed"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container2",reason="ContainerCannotRun"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container2",reason="DeadlineExceeded"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container2",reason="Error"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container2",reason="Evicted"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container2",reason="OOMKilled"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container3",reason="Completed"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container3",reason="ContainerCannotRun"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container3",reason="DeadlineExceeded"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container3",reason="Error"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container3",reason="Evicted"} 0
-kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",container="container3",reason="OOMKilled"} 0
-kube_pod_container_status_terminated{namespace="default",pod="pod0",container="container2"} 0
-kube_pod_container_status_terminated{namespace="default",pod="pod0",container="container3"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container2",reason="ContainerCreating"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container2",reason="CrashLoopBackOff"} 1
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container2",reason="CreateContainerConfigError"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container2",reason="CreateContainerError"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container2",reason="ErrImagePull"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container2",reason="ImagePullBackOff"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container2",reason="InvalidImageName"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container3",reason="ContainerCreating"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container3",reason="CrashLoopBackOff"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container3",reason="CreateContainerConfigError"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container3",reason="CreateContainerError"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container3",reason="ErrImagePull"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container3",reason="ImagePullBackOff"} 0
-kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",container="container3",reason="InvalidImageName"} 0
-kube_pod_container_status_waiting{namespace="default",pod="pod0",container="container2"} 1
-kube_pod_container_status_waiting{namespace="default",pod="pod0",container="container3"} 0
-kube_pod_created{namespace="default",pod="pod0"} 1.5e+09
-kube_pod_info{namespace="default",pod="pod0",host_ip="1.1.1.1",pod_ip="1.2.3.4",uid="abc-0",node="node1",created_by_kind="",created_by_name="",priority_class="",host_network="false"} 1
-kube_pod_labels{namespace="default",pod="pod0"} 1
-kube_pod_owner{namespace="default",pod="pod0",owner_kind="",owner_name="",owner_is_controller=""} 1
-kube_pod_restart_policy{namespace="default",pod="pod0",type="Always"} 1
-kube_pod_status_phase{namespace="default",pod="pod0",phase="Failed"} 0
-kube_pod_status_phase{namespace="default",pod="pod0",phase="Pending"} 0
-kube_pod_status_phase{namespace="default",pod="pod0",phase="Running"} 1
-kube_pod_status_phase{namespace="default",pod="pod0",phase="Succeeded"} 0
-kube_pod_status_phase{namespace="default",pod="pod0",phase="Unknown"} 0
-kube_pod_status_reason{namespace="default",pod="pod0",reason="Evicted"} 0
-kube_pod_status_reason{namespace="default",pod="pod0",reason="NodeLost"} 0
-kube_pod_status_reason{namespace="default",pod="pod0",reason="UnexpectedAdmissionError"} 0
+kube_pod_container_info{namespace="default",pod="pod0",uid="abc-0",container="container2",image="k8s.gcr.io/hyperkube2",image_id="docker://sha256:bbb",container_id="docker://cd456"} 1
+kube_pod_container_info{namespace="default",pod="pod0",uid="abc-0",container="container3",image="k8s.gcr.io/hyperkube3",image_id="docker://sha256:ccc",container_id="docker://ef789"} 1
+kube_pod_container_resource_limits{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="cpu",unit="core"} 0.2
+kube_pod_container_resource_limits{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="ephemeral_storage",unit="byte"} 3e+08
+kube_pod_container_resource_limits{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="memory",unit="byte"} 1e+08
+kube_pod_container_resource_limits{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="nvidia_com_gpu",unit="integer"} 1
+kube_pod_container_resource_limits{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="storage",unit="byte"} 4e+08
+kube_pod_container_resource_limits{namespace="default",pod="pod0",uid="abc-0",container="pod1_con2",node="node1",resource="cpu",unit="core"} 0.3
+kube_pod_container_resource_limits{namespace="default",pod="pod0",uid="abc-0",container="pod1_con2",node="node1",resource="memory",unit="byte"} 2e+08
+kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="cpu",unit="core"} 0.2
+kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="ephemeral_storage",unit="byte"} 3e+08
+kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="memory",unit="byte"} 1e+08
+kube_pod_container_resource_requests{namespace="default",pod="pod0",uid="abc-0",container="pod1_con1",node="node1",resource="nvidia_com_gpu",unit="integer"} 1
+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="container2",reason="Completed"} 0
+kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="ContainerCannotRun"} 0
+kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="DeadlineExceeded"} 0
+kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="Error"} 0
+kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="Evicted"} 0
+kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="OOMKilled"} 1
+kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="Completed"} 0
+kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="ContainerCannotRun"} 0
+kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="DeadlineExceeded"} 0
+kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="Error"} 0
+kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="Evicted"} 0
+kube_pod_container_status_last_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="OOMKilled"} 0
+kube_pod_container_status_ready{namespace="default",pod="pod0",uid="abc-0",container="container2"} 0
+kube_pod_container_status_ready{namespace="default",pod="pod0",uid="abc-0",container="container3"} 0
+kube_pod_container_status_restarts_total{namespace="default",pod="pod0",uid="abc-0",container="container2"} 0
+kube_pod_container_status_restarts_total{namespace="default",pod="pod0",uid="abc-0",container="container3"} 0
+kube_pod_container_status_running{namespace="default",pod="pod0",uid="abc-0",container="container2"} 0
+kube_pod_container_status_running{namespace="default",pod="pod0",uid="abc-0",container="container3"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="Completed"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="ContainerCannotRun"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="DeadlineExceeded"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="Error"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="Evicted"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="OOMKilled"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="Completed"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="ContainerCannotRun"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="DeadlineExceeded"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="Error"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="Evicted"} 0
+kube_pod_container_status_terminated_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="OOMKilled"} 0
+kube_pod_container_status_terminated{namespace="default",pod="pod0",uid="abc-0",container="container2"} 0
+kube_pod_container_status_terminated{namespace="default",pod="pod0",uid="abc-0",container="container3"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="ContainerCreating"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="CrashLoopBackOff"} 1
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="CreateContainerConfigError"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="CreateContainerError"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="ErrImagePull"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="ImagePullBackOff"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container2",reason="InvalidImageName"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="ContainerCreating"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="CrashLoopBackOff"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="CreateContainerConfigError"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="CreateContainerError"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="ErrImagePull"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="ImagePullBackOff"} 0
+kube_pod_container_status_waiting_reason{namespace="default",pod="pod0",uid="abc-0",container="container3",reason="InvalidImageName"} 0
+kube_pod_container_status_waiting{namespace="default",pod="pod0",uid="abc-0",container="container2"} 1
+kube_pod_container_status_waiting{namespace="default",pod="pod0",uid="abc-0",container="container3"} 0
+kube_pod_created{namespace="default",pod="pod0",uid="abc-0"} 1.5e+09
+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
+kube_pod_labels{namespace="default",pod="pod0",uid="abc-0"} 1
+kube_pod_owner{namespace="default",pod="pod0",uid="abc-0",owner_kind="",owner_name="",owner_is_controller=""} 1
+kube_pod_restart_policy{namespace="default",pod="pod0",uid="abc-0",type="Always"} 1
+kube_pod_status_phase{namespace="default",pod="pod0",uid="abc-0",phase="Failed"} 0
+kube_pod_status_phase{namespace="default",pod="pod0",uid="abc-0",phase="Pending"} 0
+kube_pod_status_phase{namespace="default",pod="pod0",uid="abc-0",phase="Running"} 1
+kube_pod_status_phase{namespace="default",pod="pod0",uid="abc-0",phase="Succeeded"} 0
+kube_pod_status_phase{namespace="default",pod="pod0",uid="abc-0",phase="Unknown"} 0
+kube_pod_status_reason{namespace="default",pod="pod0",uid="abc-0",reason="Evicted"} 0
+kube_pod_status_reason{namespace="default",pod="pod0",uid="abc-0",reason="NodeLost"} 0
+kube_pod_status_reason{namespace="default",pod="pod0",uid="abc-0",reason="UnexpectedAdmissionError"} 0
`
expectedSplit := strings.Split(strings.TrimSpace(expected), "\n")