Skip to content

Commit

Permalink
Deprecate apiserver_longrunning_gauge metric in favor of apiserver_lo…
Browse files Browse the repository at this point in the history
…ngrunning_requests (#14856)

* Deprecate apiserver_longrunning_gauge in favor of apiserver_longrunning_requests

* Add longrunning_requests metric to the metadata

* Override the longrunning_gauge metric for backwards compatibility

* Fix metadata validation

* fix tests

* Fix metadata
  • Loading branch information
arapulido authored Jul 3, 2023
1 parent e10f250 commit 5087dd2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

METRICS = {
'apiserver_current_inflight_requests': 'current_inflight_requests',
# Deprecated in 1.23 (replaced by apiserver_longrunning_requests)
'apiserver_longrunning_gauge': 'longrunning_gauge',
'go_threads': 'go_threads',
'go_goroutines': 'go_goroutines',
Expand Down Expand Up @@ -62,6 +63,8 @@
# https://kubernetes.io/docs/reference/using-api/deprecation-policy/#rest-resources-aka-api-objects
'apiserver_requested_deprecated_apis': 'requested_deprecated_apis',
# For Kubernetes >= 1.23
# https://github.com/kubernetes/kubernetes/pull/103799
'apiserver_longrunning_requests': 'longrunning_gauge',
# https://github.com/kubernetes/kubernetes/pull/104983
'apiserver_storage_list_total': 'storage_list_total',
'apiserver_storage_list_fetched_objects_total': 'storage_list_fetched_objects_total',
Expand Down
2 changes: 1 addition & 1 deletion kube_apiserver_metrics/metadata.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name,curated_metric
kube_apiserver.longrunning_gauge,gauge,,request,,The gauge of all active long-running apiserver requests broken out by verb API resource and scope. Not all requests are tracked this way.,-1,kubernetes_api_server_metrics,long running gauges,
kube_apiserver.longrunning_gauge,gauge,,request,,"The gauge of all active long-running apiserver requests broken out by verb, group, version, resource, scope, and component. Not all requests are tracked this way.",-1,kubernetes_api_server_metrics,long running gauges,
kube_apiserver.current_inflight_requests,gauge,,,,The maximal number of currently used inflight request limit of this apiserver per request kind in last second.,0,kubernetes_api_server_metrics,current inflight requests,
kube_apiserver.audit_event,gauge,,event,,The accumulated number audit events generated and sent to the audit backend,1,kubernetes_api_server_metrics,accumulated audit events,
kube_apiserver.go_threads,gauge,,thread,,The number of OS threads created,0,kubernetes_api_server_metrics,go threads,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class TestKubeAPIServerMetrics:
"""Basic Test for kube_apiserver integration."""

METRICS = [
'longrunning_gauge',
'current_inflight_requests',
'audit_event',
'go_threads',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class TestKubeAPIServerMetrics:
CHECK_NAME = 'kube_apiserver_metrics'
NAMESPACE = 'kube_apiserver'
METRICS = [
NAMESPACE + '.longrunning_gauge',
NAMESPACE + '.current_inflight_requests',
NAMESPACE + '.audit_event',
NAMESPACE + '.go_threads',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class TestKubeAPIServerMetrics:
"""Basic Test for kube_apiserver integration."""

METRICS = [
'longrunning_gauge',
'current_inflight_requests',
'audit_event',
'go_threads',
Expand Down

0 comments on commit 5087dd2

Please sign in to comment.