Skip to content

Commit 75fba81

Browse files
authored
Merge pull request #2527 from mrueg/rm-deprecated-metric
chore: Remove deprecated endpoint address metric
2 parents e295191 + 28129e4 commit 75fba81

File tree

3 files changed

+0
-59
lines changed

3 files changed

+0
-59
lines changed

docs/metrics/service/endpoint-metrics.md

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
| Metric name | Metric type | Description | Labels/tags | Status |
44
| ------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
55
| kube_endpoint_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; <br> `annotation_ENDPOINT_ANNOTATION`=&lt;ENDPOINT_ANNOTATION&gt; | EXPERIMENTAL |
6-
| kube_endpoint_address_not_ready | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | DEPRECATED |
7-
| kube_endpoint_address_available | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | DEPRECATED |
86
| kube_endpoint_info | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | STABLE |
97
| kube_endpoint_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; <br> `label_ENDPOINT_LABEL`=&lt;ENDPOINT_LABEL&gt; | STABLE |
108
| kube_endpoint_created | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | STABLE |

internal/store/endpoint.go

-41
Original file line numberDiff line numberDiff line change
@@ -123,47 +123,6 @@ func endpointMetricFamilies(allowAnnotationsList, allowLabelsList []string) []ge
123123
}
124124
}),
125125
),
126-
*generator.NewFamilyGeneratorWithStability(
127-
"kube_endpoint_address_available",
128-
"Number of addresses available in endpoint.",
129-
metric.Gauge,
130-
basemetrics.ALPHA,
131-
"v2.6.0",
132-
wrapEndpointFunc(func(e *v1.Endpoints) *metric.Family {
133-
var available int
134-
for _, s := range e.Subsets {
135-
available += len(s.Addresses) * len(s.Ports)
136-
}
137-
138-
return &metric.Family{
139-
Metrics: []*metric.Metric{
140-
{
141-
Value: float64(available),
142-
},
143-
},
144-
}
145-
}),
146-
),
147-
*generator.NewFamilyGeneratorWithStability(
148-
"kube_endpoint_address_not_ready",
149-
"Number of addresses not ready in endpoint",
150-
metric.Gauge,
151-
basemetrics.ALPHA,
152-
"v2.6.0",
153-
wrapEndpointFunc(func(e *v1.Endpoints) *metric.Family {
154-
var notReady int
155-
for _, s := range e.Subsets {
156-
notReady += len(s.NotReadyAddresses) * len(s.Ports)
157-
}
158-
return &metric.Family{
159-
Metrics: []*metric.Metric{
160-
{
161-
Value: float64(notReady),
162-
},
163-
},
164-
}
165-
}),
166-
),
167126
*generator.NewFamilyGeneratorWithStability(
168127
"kube_endpoint_address",
169128
"Information about Endpoint available and non available addresses.",

internal/store/endpoint_test.go

-16
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ func TestEndpointStore(t *testing.T) {
3232
const metadata = `
3333
# HELP kube_endpoint_annotations Kubernetes annotations converted to Prometheus labels.
3434
# TYPE kube_endpoint_annotations gauge
35-
# HELP kube_endpoint_address_available (Deprecated since v2.6.0) Number of addresses available in endpoint.
36-
# TYPE kube_endpoint_address_available gauge
37-
# HELP kube_endpoint_address_not_ready (Deprecated since v2.6.0) Number of addresses not ready in endpoint
38-
# TYPE kube_endpoint_address_not_ready gauge
3935
# HELP kube_endpoint_created [STABLE] Unix creation timestamp
4036
# TYPE kube_endpoint_created gauge
4137
# HELP kube_endpoint_info [STABLE] Information about endpoint.
@@ -89,8 +85,6 @@ func TestEndpointStore(t *testing.T) {
8985
},
9086
},
9187
Want: metadata + `
92-
kube_endpoint_address_available{endpoint="test-endpoint",namespace="default"} 6
93-
kube_endpoint_address_not_ready{endpoint="test-endpoint",namespace="default"} 6
9488
kube_endpoint_created{endpoint="test-endpoint",namespace="default"} 1.5e+09
9589
kube_endpoint_info{endpoint="test-endpoint",namespace="default"} 1
9690
kube_endpoint_ports{endpoint="test-endpoint",namespace="default",port_name="http",port_protocol="TCP",port_number="8080"} 1
@@ -132,8 +126,6 @@ func TestEndpointStore(t *testing.T) {
132126
},
133127
},
134128
Want: metadata + `
135-
kube_endpoint_address_available{endpoint="single-port-endpoint",namespace="default"} 2
136-
kube_endpoint_address_not_ready{endpoint="single-port-endpoint",namespace="default"} 1
137129
kube_endpoint_created{endpoint="single-port-endpoint",namespace="default"} 1.5e+09
138130
kube_endpoint_info{endpoint="single-port-endpoint",namespace="default"} 1
139131
kube_endpoint_ports{endpoint="single-port-endpoint",namespace="default",port_name="",port_number="8080",port_protocol="TCP"} 1
@@ -156,10 +148,6 @@ func TestEndpointStoreWithLabels(t *testing.T) {
156148
// Fixed metadata on type and help text. We prepend this to every expected
157149
// output so we only have to modify a single place when doing adjustments.
158150
const metadata = `
159-
# HELP kube_endpoint_address_available (Deprecated since v2.6.0) Number of addresses available in endpoint.
160-
# TYPE kube_endpoint_address_available gauge
161-
# HELP kube_endpoint_address_not_ready (Deprecated since v2.6.0) Number of addresses not ready in endpoint
162-
# TYPE kube_endpoint_address_not_ready gauge
163151
# HELP kube_endpoint_annotations Kubernetes annotations converted to Prometheus labels.
164152
# TYPE kube_endpoint_annotations gauge
165153
# HELP kube_endpoint_created [STABLE] Unix creation timestamp
@@ -218,8 +206,6 @@ func TestEndpointStoreWithLabels(t *testing.T) {
218206
},
219207
},
220208
Want: metadata + `
221-
kube_endpoint_address_available{endpoint="test-endpoint",namespace="default"} 6
222-
kube_endpoint_address_not_ready{endpoint="test-endpoint",namespace="default"} 6
223209
kube_endpoint_annotations{endpoint="test-endpoint",annotation_app="foobar",namespace="default"} 1
224210
kube_endpoint_created{endpoint="test-endpoint",namespace="default"} 1.5e+09
225211
kube_endpoint_info{endpoint="test-endpoint",namespace="default"} 1
@@ -267,8 +253,6 @@ func TestEndpointStoreWithLabels(t *testing.T) {
267253
},
268254
Want: metadata + `
269255
kube_endpoint_annotations{endpoint="single-port-endpoint",annotation_app="single-foobar",namespace="default"} 1
270-
kube_endpoint_address_available{endpoint="single-port-endpoint",namespace="default"} 2
271-
kube_endpoint_address_not_ready{endpoint="single-port-endpoint",namespace="default"} 1
272256
kube_endpoint_created{endpoint="single-port-endpoint",namespace="default"} 1.5e+09
273257
kube_endpoint_info{endpoint="single-port-endpoint",namespace="default"} 1
274258
kube_endpoint_labels{endpoint="single-port-endpoint",label_app="single-foobar",namespace="default"} 1

0 commit comments

Comments
 (0)