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. Therefore, even
though some metrics are deprecated, we can't remove them.

In Kubernetes v1.24 `apiserver_dropped_requests_total` is deprecated in
favor of `apiserver_request_total`. It is hidden in v1.25. This commit
allowlists the deprecated metric, because it is used in a Grafana
dashboard. It was dropped from the allowlist by mistake in gardener#3502.

In Kubernetes v1.23, `apiserver_registered_watchers` is deprecated in favor
of `apiserver_longrunning_requests`. It is hidden in v1.24.

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 d36d894 commit b519caf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 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,8 @@ const (
monitoringMetricApiserverCRDWebhookConversionDurationSeconds = "apiserver_crd_webhook_conversion_duration_seconds_.+"
monitoringMetricApiserverCurrentInflightRequests = "apiserver_current_inflight_requests"
monitoringMetricApiserverCurrentInqueueRequests = "apiserver_current_inqueue_requests"
monitoringMetricApiserverDroppedRequestsTotal = "apiserver_dropped_requests_total"
monitoringMetricApiserverLongrunningRequests = "apiserver_longrunning_requests"
monitoringMetricApiserverResponseSizes = "apiserver_response_sizes_.+"
monitoringMetricApiserverRegisteredWatchers = "apiserver_registered_watchers"
monitoringMetricApiserverRequestDurationSeconds = "apiserver_request_duration_seconds_.+"
Expand Down Expand Up @@ -218,6 +220,8 @@ var (
monitoringMetricApiserverCRDWebhookConversionDurationSeconds,
monitoringMetricApiserverCurrentInflightRequests,
monitoringMetricApiserverCurrentInqueueRequests,
monitoringMetricApiserverDroppedRequestsTotal,
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_dropped_requests_total|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 b519caf

Please sign in to comment.