Skip to content

Commit

Permalink
feat: add kube_apiserver.etcd.db.total_size metric (#10569)
Browse files Browse the repository at this point in the history
feat: add kube_apiserver.etcd.db.total_size metric

the `kube_apiserver.etcd.db.total_size` metric is a gauge representing
the total size of the etcd database file physically allocated in bytes.

In addition, this commit fix the deprecation warning report by the CI about
the `instance` argument used in the `check()` function.

Refs: #10472
  • Loading branch information
clamoriniere committed Nov 9, 2021
1 parent b1157b2 commit 5455002
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'APIServiceRegistrationController_depth': 'APIServiceRegistrationController_depth',
'etcd_object_counts': 'etcd_object_counts',
'etcd_request_duration_seconds': 'etcd_request_duration_seconds',
'etcd_db_total_size_in_bytes': 'etcd.db.total_size',
'apiserver_registered_watchers': 'registered_watchers',
'apiserver_request_duration_seconds': 'request_duration_seconds',
'apiserver_request_latencies': 'request_latencies',
Expand Down Expand Up @@ -94,7 +95,7 @@ def __init__(self, name, init_config, instances=None):

def check(self, instance):
if self.kube_apiserver_config is None:
self.kube_apiserver_config = self.get_scraper_config(instance)
self.kube_apiserver_config = self.get_scraper_config(self.instance)

if not self.kube_apiserver_config['metrics_mapper']:
url = self.kube_apiserver_config['prometheus_url']
Expand Down
1 change: 1 addition & 0 deletions kube_apiserver_metrics/metadata.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ kube_apiserver.go_threads,gauge,,thread,,Number of OS threads created,0, kube_ap
kube_apiserver.go_goroutines,gauge,,,,Number of goroutines that currently exist,0, kube_apiserver, go routines
kube_apiserver.APIServiceRegistrationController_depth,gauge,,,,Current depth of workqueue: APIServiceRegistrationController,0, kube_apiserver, service registration controller depth
kube_apiserver.etcd_object_counts,gauge,,object,,Number of stored objects at the time of last check split by kind,0, kube_apiserver, etcd object counts
kube_apiserver.etcd.db.total_size,gauge,,byte,,The total size of the etcd database file physically allocated in bytes (Only present from Kubernetes 1.19; this metric can be removed in a future Kubernetes version since it is still in alpha),0, kube_apiserver, etcd db total size
kube_apiserver.rest_client_requests_total,gauge,,request,,Accumulated number of HTTP requests partitioned by status code method and host,1, kube_apiserver, accumulated rest client requests
kube_apiserver.apiserver_request_count,gauge,,request,,Accumulated number of apiserver requests broken out for each verb API resource client and HTTP response contentType and code (deprecated since kubernetes 1.15),1, kube_apiserver, accumulated number of requests
kube_apiserver.apiserver_dropped_requests_total,gauge,,request,,Accumulated number of requests dropped with 'Try again later' response,1, kube_apiserver, accumulated number of dropped requests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class TestKubeAPIServerMetrics:
NAMESPACE + '.go_threads',
NAMESPACE + '.go_goroutines',
NAMESPACE + '.etcd_object_counts',
NAMESPACE + '.etcd.db.total_size',
NAMESPACE + '.rest_client_requests_total',
NAMESPACE + '.authenticated_user_requests',
NAMESPACE + '.apiserver_request_total',
Expand Down

0 comments on commit 5455002

Please sign in to comment.