Skip to content

Commit

Permalink
Merge pull request #2527 from mrueg/rm-deprecated-metric
Browse files Browse the repository at this point in the history
chore: Remove deprecated endpoint address metric
  • Loading branch information
k8s-ci-robot authored Oct 16, 2024
2 parents e295191 + 28129e4 commit 75fba81
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 59 deletions.
2 changes: 0 additions & 2 deletions docs/metrics/service/endpoint-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| 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 |
| kube_endpoint_address_not_ready | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | DEPRECATED |
| kube_endpoint_address_available | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | DEPRECATED |
| kube_endpoint_info | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | STABLE |
| 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 |
| kube_endpoint_created | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | STABLE |
Expand Down
41 changes: 0 additions & 41 deletions internal/store/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,47 +123,6 @@ func endpointMetricFamilies(allowAnnotationsList, allowLabelsList []string) []ge
}
}),
),
*generator.NewFamilyGeneratorWithStability(
"kube_endpoint_address_available",
"Number of addresses available in endpoint.",
metric.Gauge,
basemetrics.ALPHA,
"v2.6.0",
wrapEndpointFunc(func(e *v1.Endpoints) *metric.Family {
var available int
for _, s := range e.Subsets {
available += len(s.Addresses) * len(s.Ports)
}

return &metric.Family{
Metrics: []*metric.Metric{
{
Value: float64(available),
},
},
}
}),
),
*generator.NewFamilyGeneratorWithStability(
"kube_endpoint_address_not_ready",
"Number of addresses not ready in endpoint",
metric.Gauge,
basemetrics.ALPHA,
"v2.6.0",
wrapEndpointFunc(func(e *v1.Endpoints) *metric.Family {
var notReady int
for _, s := range e.Subsets {
notReady += len(s.NotReadyAddresses) * len(s.Ports)
}
return &metric.Family{
Metrics: []*metric.Metric{
{
Value: float64(notReady),
},
},
}
}),
),
*generator.NewFamilyGeneratorWithStability(
"kube_endpoint_address",
"Information about Endpoint available and non available addresses.",
Expand Down
16 changes: 0 additions & 16 deletions internal/store/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ 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 (Deprecated since v2.6.0) Number of addresses available in endpoint.
# TYPE kube_endpoint_address_available gauge
# 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 [STABLE] Unix creation timestamp
# TYPE kube_endpoint_created gauge
# HELP kube_endpoint_info [STABLE] Information about endpoint.
Expand Down Expand Up @@ -89,8 +85,6 @@ func TestEndpointStore(t *testing.T) {
},
},
Want: metadata + `
kube_endpoint_address_available{endpoint="test-endpoint",namespace="default"} 6
kube_endpoint_address_not_ready{endpoint="test-endpoint",namespace="default"} 6
kube_endpoint_created{endpoint="test-endpoint",namespace="default"} 1.5e+09
kube_endpoint_info{endpoint="test-endpoint",namespace="default"} 1
kube_endpoint_ports{endpoint="test-endpoint",namespace="default",port_name="http",port_protocol="TCP",port_number="8080"} 1
Expand Down Expand Up @@ -132,8 +126,6 @@ func TestEndpointStore(t *testing.T) {
},
},
Want: metadata + `
kube_endpoint_address_available{endpoint="single-port-endpoint",namespace="default"} 2
kube_endpoint_address_not_ready{endpoint="single-port-endpoint",namespace="default"} 1
kube_endpoint_created{endpoint="single-port-endpoint",namespace="default"} 1.5e+09
kube_endpoint_info{endpoint="single-port-endpoint",namespace="default"} 1
kube_endpoint_ports{endpoint="single-port-endpoint",namespace="default",port_name="",port_number="8080",port_protocol="TCP"} 1
Expand All @@ -156,10 +148,6 @@ 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 (Deprecated since v2.6.0) Number of addresses available in endpoint.
# TYPE kube_endpoint_address_available gauge
# 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
# HELP kube_endpoint_created [STABLE] Unix creation timestamp
Expand Down Expand Up @@ -218,8 +206,6 @@ func TestEndpointStoreWithLabels(t *testing.T) {
},
},
Want: metadata + `
kube_endpoint_address_available{endpoint="test-endpoint",namespace="default"} 6
kube_endpoint_address_not_ready{endpoint="test-endpoint",namespace="default"} 6
kube_endpoint_annotations{endpoint="test-endpoint",annotation_app="foobar",namespace="default"} 1
kube_endpoint_created{endpoint="test-endpoint",namespace="default"} 1.5e+09
kube_endpoint_info{endpoint="test-endpoint",namespace="default"} 1
Expand Down Expand Up @@ -267,8 +253,6 @@ func TestEndpointStoreWithLabels(t *testing.T) {
},
Want: metadata + `
kube_endpoint_annotations{endpoint="single-port-endpoint",annotation_app="single-foobar",namespace="default"} 1
kube_endpoint_address_available{endpoint="single-port-endpoint",namespace="default"} 2
kube_endpoint_address_not_ready{endpoint="single-port-endpoint",namespace="default"} 1
kube_endpoint_created{endpoint="single-port-endpoint",namespace="default"} 1.5e+09
kube_endpoint_info{endpoint="single-port-endpoint",namespace="default"} 1
kube_endpoint_labels{endpoint="single-port-endpoint",label_app="single-foobar",namespace="default"} 1
Expand Down

0 comments on commit 75fba81

Please sign in to comment.