From 9f7d1af2998aac72477c63ba22e815433d493c3c Mon Sep 17 00:00:00 2001 From: Mario Constanti Date: Tue, 23 Aug 2022 09:06:49 +0200 Subject: [PATCH] graduate new endpoint metrics to STABLE * graduate kube_endpoint_ports and kube_endpoint_address to STABLE * graduate kube_endpoint_address_not_ready and kube_endpoint_address_available to DEPRECATED as the information is precomputed during metrics-scraping Signed-off-by: Mario Constanti --- docs/endpoint-metrics.md | 8 ++++---- internal/store/endpoint.go | 4 ++-- internal/store/endpoint_test.go | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/endpoint-metrics.md b/docs/endpoint-metrics.md index 6afc817488..281772b20d 100644 --- a/docs/endpoint-metrics.md +++ b/docs/endpoint-metrics.md @@ -3,10 +3,10 @@ | Metric name| Metric type | Labels/tags | Status | | ---------- | ----------- | ----------- | ----------- | | kube_endpoint_annotations | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace>
`annotation_ENDPOINT_ANNOTATION`=<ENDPOINT_ANNOTATION> | EXPERIMENTAL | -| kube_endpoint_address_not_ready | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace> | STABLE | -| kube_endpoint_address_available | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace> | STABLE | +| kube_endpoint_address_not_ready | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace> | DEPRECATED | +| kube_endpoint_address_available | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace> | DEPRECATED | | kube_endpoint_info | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace> | STABLE | | kube_endpoint_labels | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace>
`label_ENDPOINT_LABEL`=<ENDPOINT_LABEL> | STABLE | | kube_endpoint_created | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace> | STABLE | -| kube_endpoint_ports | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace>
`port_name`=<endpoint-port-name>
`port_protocol`=<endpoint-port-protocol>
`port_number`=<endpoint-port-number> | EXPERIMENTAL | -| kube_endpoint_address | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace>
`ip`=<endpoint-ip>
`ready`=<true if available, false if unavailalbe> | EXPERIMENTAL | +| kube_endpoint_ports | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace>
`port_name`=<endpoint-port-name>
`port_protocol`=<endpoint-port-protocol>
`port_number`=<endpoint-port-number> | STABLE | +| kube_endpoint_address | Gauge | `endpoint`=<endpoint-name>
`namespace`=<endpoint-namespace>
`ip`=<endpoint-ip>
`ready`=<true if available, false if unavailalbe> | STABLE | diff --git a/internal/store/endpoint.go b/internal/store/endpoint.go index a2ab994339..8a26477a15 100644 --- a/internal/store/endpoint.go +++ b/internal/store/endpoint.go @@ -116,7 +116,7 @@ func endpointMetricFamilies(allowAnnotationsList, allowLabelsList []string) []ge "kube_endpoint_address_available", "Number of addresses available in endpoint.", metric.Gauge, - "", + "v2.6.0", wrapEndpointFunc(func(e *v1.Endpoints) *metric.Family { var available int for _, s := range e.Subsets { @@ -136,7 +136,7 @@ func endpointMetricFamilies(allowAnnotationsList, allowLabelsList []string) []ge "kube_endpoint_address_not_ready", "Number of addresses not ready in endpoint", metric.Gauge, - "", + "v2.6.0", wrapEndpointFunc(func(e *v1.Endpoints) *metric.Family { var notReady int for _, s := range e.Subsets { diff --git a/internal/store/endpoint_test.go b/internal/store/endpoint_test.go index 69af58e791..3dfb49c818 100644 --- a/internal/store/endpoint_test.go +++ b/internal/store/endpoint_test.go @@ -32,9 +32,9 @@ func TestEndpointStore(t *testing.T) { const metadata = ` # HELP kube_endpoint_annotations Kubernetes annotations converted to Prometheus labels. # TYPE kube_endpoint_annotations gauge - # HELP kube_endpoint_address_available Number of addresses available in endpoint. + # HELP kube_endpoint_address_available (Deprecated since v2.6.0) Number of addresses available in endpoint. # TYPE kube_endpoint_address_available gauge - # HELP kube_endpoint_address_not_ready Number of addresses not ready in endpoint + # HELP kube_endpoint_address_not_ready (Deprecated since v2.6.0) Number of addresses not ready in endpoint # TYPE kube_endpoint_address_not_ready gauge # HELP kube_endpoint_created Unix creation timestamp # TYPE kube_endpoint_created gauge @@ -160,9 +160,9 @@ func TestEndpointStoreWithLabels(t *testing.T) { // Fixed metadata on type and help text. We prepend this to every expected // output so we only have to modify a single place when doing adjustments. const metadata = ` - # HELP kube_endpoint_address_available Number of addresses available in endpoint. + # HELP kube_endpoint_address_available (Deprecated since v2.6.0) Number of addresses available in endpoint. # TYPE kube_endpoint_address_available gauge - # HELP kube_endpoint_address_not_ready Number of addresses not ready in endpoint + # HELP kube_endpoint_address_not_ready (Deprecated since v2.6.0) Number of addresses not ready in endpoint # TYPE kube_endpoint_address_not_ready gauge # HELP kube_endpoint_annotations Kubernetes annotations converted to Prometheus labels. # TYPE kube_endpoint_annotations gauge