From 3a52493d9249ebfc9b196e054a24a516f7376db1 Mon Sep 17 00:00:00 2001 From: Ryan Olds Date: Thu, 29 Dec 2022 14:26:57 -0800 Subject: [PATCH] Addressed feedback --- docs/pod-metrics.md | 5 +++-- internal/store/pod.go | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/pod-metrics.md b/docs/pod-metrics.md index a524d42207..30f9af858d 100644 --- a/docs/pod-metrics.md +++ b/docs/pod-metrics.md @@ -1,4 +1,5 @@ # Pod Metrics + | Metric name| Metric type | Description | Unit (where applicable) | Labels/tags | Status | Opt-in | | ---------- | ----------- |-----------------------------------------------------------------------| ----------------------- | ----------- | ------ | ------ | | kube_pod_annotations | Gauge | Kubernetes annotations converted to Prometheus labels | | `pod`=<pod-name>
`namespace`=<pod-namespace>
`annotation_POD_ANNOTATION`=<POD_ANNOTATION>
`uid`=<pod-uid> | EXPERIMENTAL | - @@ -11,8 +12,8 @@ | kube_pod_nodeselectors| Gauge | Describes the Pod nodeSelectors | | `pod`=<pod-name>
`namespace`=<pod-namespace>
`nodeselector_NODE_SELECTOR`=<NODE_SELECTOR>
`uid`=<pod-uid> | EXPERIMENTAL | Opt-in | | kube_pod_status_phase | Gauge | The pods current phase | | `pod`=<pod-name>
`namespace`=<pod-namespace>
`phase`=<Pending\|Running\|Succeeded\|Failed\|Unknown>
`uid`=<pod-uid> | STABLE | - | | kube_pod_status_ready | Gauge | Describes whether the pod is ready to serve requests | | `pod`=<pod-name>
`namespace`=<pod-namespace>
`condition`=<true\|false\|unknown>
`uid`=<pod-uid> | STABLE | - | -| kube_pod_status_ready_time | Gauge | Time when pod passed readiness probes. | seconds | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE | -| kube_pod_status_container_ready_time | Gauge | Time when the container of the pod entered Ready state. | seconds | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE | +| kube_pod_status_ready_time | Gauge | Time when pod passed readiness probes. | seconds | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL | +| kube_pod_status_container_ready_time | Gauge | Time when the container of the pod entered Ready state. | seconds | `pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | EXPERIMENTAL | | kube_pod_status_scheduled | Gauge | Describes the status of the scheduling process for the pod | |`pod`=<pod-name>
`namespace`=<pod-namespace>
`condition`=<true\|false\|unknown>
`uid`=<pod-uid> | STABLE | - | | kube_pod_container_info | Gauge | Information about a container in a pod | | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`image`=<image-name>
`image_id`=<image-id>
`image_spec`=<image-spec>
`container_id`=<containerid>
`uid`=<pod-uid> | STABLE | - | | kube_pod_container_status_waiting | Gauge | Describes whether the container is currently in waiting state | | `container`=<container-name>
`pod`=<pod-name>
`namespace`=<pod-namespace>
`uid`=<pod-uid> | STABLE | - | diff --git a/internal/store/pod.go b/internal/store/pod.go index 8d6ca2db31..d9260b7aa9 100644 --- a/internal/store/pod.go +++ b/internal/store/pod.go @@ -1320,10 +1320,11 @@ func createPodStatusPhaseFamilyGenerator() generator.FamilyGenerator { } func createPodStatusContainerReadyTimeFamilyGenerator() generator.FamilyGenerator { - return *generator.NewFamilyGenerator( + return *generator.NewFamilyGeneratorWithStability( "kube_pod_status_container_ready_time", "Readiness achieved time in unix timestamp for a pod containers.", metric.Gauge, + basemetrics.ALPHA, "", wrapPodFunc(func(p *v1.Pod) *metric.Family { ms := []*metric.Metric{} @@ -1346,10 +1347,11 @@ func createPodStatusContainerReadyTimeFamilyGenerator() generator.FamilyGenerato } func createPodStatusReadyTimeFamilyGenerator() generator.FamilyGenerator { - return *generator.NewFamilyGenerator( + return *generator.NewFamilyGeneratorWithStability( "kube_pod_status_ready_time", "Readiness achieved time in unix timestamp for a pod.", metric.Gauge, + basemetrics.ALPHA, "", wrapPodFunc(func(p *v1.Pod) *metric.Family { ms := []*metric.Metric{}