Skip to content

Commit

Permalink
Add API server metrics to allowlist
Browse files Browse the repository at this point in the history
Gardener currently supports Kubernetes v1.20 to v1.25.

In Kubernetes v1.23, `apiserver_registered_watchers` is deprecated in favor
of `apiserver_longrunning_requests`. It is hidden in v1.24. This commit
adds the new metric, `apiserver_longrunning_requests` to the allowlist.

Co-authored-by: Istvan Zoltan Ballok <[email protected]>
Co-authored-by: Jeremy Rickards <[email protected]>
  • Loading branch information
rickardsjp and istvanballok committed Mar 17, 2023
1 parent e8d71ff commit 237a55c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/operation/botanist/component/kubeapiserver/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const (
monitoringMetricApiserverCRDWebhookConversionDurationSeconds = "apiserver_crd_webhook_conversion_duration_seconds_.+"
monitoringMetricApiserverCurrentInflightRequests = "apiserver_current_inflight_requests"
monitoringMetricApiserverCurrentInqueueRequests = "apiserver_current_inqueue_requests"
monitoringMetricApiserverLongrunningRequests = "apiserver_longrunning_requests"
monitoringMetricApiserverResponseSizes = "apiserver_response_sizes_.+"
monitoringMetricApiserverRegisteredWatchers = "apiserver_registered_watchers"
monitoringMetricApiserverRequestDurationSeconds = "apiserver_request_duration_seconds_.+"
Expand Down Expand Up @@ -218,6 +219,7 @@ var (
monitoringMetricApiserverCRDWebhookConversionDurationSeconds,
monitoringMetricApiserverCurrentInflightRequests,
monitoringMetricApiserverCurrentInqueueRequests,
monitoringMetricApiserverLongrunningRequests,
monitoringMetricApiserverResponseSizes,
monitoringMetricApiserverRegisteredWatchers,
monitoringMetricApiserverRequestDurationSeconds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ relabel_configs:
metric_relabel_configs:
- source_labels: [ __name__ ]
action: keep
regex: ^(authentication_attempts|authenticated_user_requests|apiserver_admission_controller_admission_duration_seconds_.+|apiserver_admission_webhook_admission_duration_seconds_.+|apiserver_admission_step_admission_duration_seconds_.+|apiserver_admission_webhook_rejection_count|apiserver_audit_event_total|apiserver_audit_error_total|apiserver_audit_requests_rejected_total|apiserver_latency_seconds|apiserver_crd_webhook_conversion_duration_seconds_.+|apiserver_current_inflight_requests|apiserver_current_inqueue_requests|apiserver_response_sizes_.+|apiserver_registered_watchers|apiserver_request_duration_seconds_.+|apiserver_request_terminations_total|apiserver_request_total|apiserver_request_count|apiserver_storage_transformation_duration_seconds_.+|apiserver_storage_transformation_operations_total|apiserver_init_events_total|apiserver_watch_events_sizes_.+|apiserver_watch_events_total|etcd_db_total_size_in_bytes|apiserver_storage_db_total_size_in_bytes|etcd_object_counts|apiserver_storage_objects|etcd_request_duration_seconds_.+|go_.+|process_max_fds|process_open_fds|watch_cache_capacity_increase_total|watch_cache_capacity_decrease_total|watch_cache_capacity|apiserver_cache_list_.+|apiserver_storage_list_.+)$
regex: ^(authentication_attempts|authenticated_user_requests|apiserver_admission_controller_admission_duration_seconds_.+|apiserver_admission_webhook_admission_duration_seconds_.+|apiserver_admission_step_admission_duration_seconds_.+|apiserver_admission_webhook_rejection_count|apiserver_audit_event_total|apiserver_audit_error_total|apiserver_audit_requests_rejected_total|apiserver_latency_seconds|apiserver_crd_webhook_conversion_duration_seconds_.+|apiserver_current_inflight_requests|apiserver_current_inqueue_requests|apiserver_longrunning_requests|apiserver_response_sizes_.+|apiserver_registered_watchers|apiserver_request_duration_seconds_.+|apiserver_request_terminations_total|apiserver_request_total|apiserver_request_count|apiserver_storage_transformation_duration_seconds_.+|apiserver_storage_transformation_operations_total|apiserver_init_events_total|apiserver_watch_events_sizes_.+|apiserver_watch_events_total|etcd_db_total_size_in_bytes|apiserver_storage_db_total_size_in_bytes|etcd_object_counts|apiserver_storage_objects|etcd_request_duration_seconds_.+|go_.+|process_max_fds|process_open_fds|watch_cache_capacity_increase_total|watch_cache_capacity_decrease_total|watch_cache_capacity|apiserver_cache_list_.+|apiserver_storage_list_.+)$
`

expectedAlertingRule = `groups:
Expand Down

0 comments on commit 237a55c

Please sign in to comment.