Overview

The Kubernetes API Server is the central management entity that exposes the Kubernetes API. All kubectl commands, cluster components, and external clients interact with it.

Why it’s Useful

  • Detects slow API calls or high error rates.
  • Identifies request bottlenecks impacting cluster operations.
  • Ensures cluster remains responsive under load.

What Users Can Do

  • Monitor API latency and error rates.
  • Adjust scrape intervals for fine-grained monitoring.
  • Troubleshoot failed requests and downtime issues.

Steps to Configure

  1. Get the existing ConfigMap.
    kubectl get cm opsramp-k8s-infra-metric-user-config -n <agent-installed-namespace> -o yaml
  2. Edit the ConfigMap.
    kubectl edit cm opsramp-k8s-infra-metric-user-config -n <agent-installed-namespace>
  3. Locate the apiserver section in ConfigMap.
    k8s_cluster:
      enabled: true
      config:
        scrape_interval: "2m"
  4. Update the required parameters.
  5. Save and apply the changes.

Supported Metrics

Metric NameDescription
aggregator_discovery_aggregation_countNumber of aggregated discovery requests served by the API aggregator.
aggregator_unavailable_apiserviceIndicates if an API service registered with the aggregator is currently unavailable.
apiextensions_apiserver_validation_ratcheting_secondsTime taken by the API extensions server to validate and apply ratcheting for CRD updates.
apiextensions_openapi_v2_regenerationTracks regeneration events for OpenAPI V2 specifications by the API extensions server.
apiextensions_openapi_v3_regenerationTracks regeneration events for OpenAPI V3 specifications by the API extensions server.
apiserver_storage_objectsTotal number of stored objects per resource type in etcd.
apiserver_admission_controller_admission_duration_secondsTime taken by admission controllers to admit or deny incoming API requests.
apiserver_admission_step_admission_duration_secondsDuration of each admission control step within the API server request flow.
apiserver_admission_step_admission_duration_seconds_summarySummary statistics of admission step durations within the API server.
apiserver_audit_eventNumber of audit events generated by the API server.
apiserver_audit_requests_rejectedCount of audit events rejected due to misconfiguration or buffer overflow.
apiserver_authorization_decisionsNumber of authorization decisions made (allowed or denied) by the API server.
apiserver_cache_list_fetched_objectsNumber of objects fetched during list operations served from cache.
apiserver_cache_list_returned_objectsNumber of objects returned by list operations from the cache.
apiserver_cache_listTracks cache hit and miss rates for API list requests.
apiserver_cel_compilation_duration_secondsDuration to compile CEL (Common Expression Language) expressions in admission webhooks.
apiserver_cel_evaluation_duration_secondsDuration to evaluate CEL expressions during admission control.
apiserver_client_certificate_expiration_secondsTime remaining before client certificates used by the API server expire.
apiserver_clusterip_repair_reconcile_errorsNumber of errors encountered while reconciling cluster IP allocations.
apiserver_current_inflight_requestsNumber of active requests currently being processed by the API server.
apiserver_current_inqueue_requestsNumber of requests currently waiting in the API server request queue.
apiserver_envelope_encryption_dek_cache_fill_percentPercentage of the encryption key cache filled for envelope encryption.
apiserver_flowcontrol_current_executing_requestsNumber of currently executing requests under API Priority and Fairness (APF) control.
apiserver_flowcontrol_current_executing_seatsNumber of active execution "seats" used by requests in APF.
apiserver_flowcontrol_current_inqueue_requestsNumber of queued requests under API Priority and Fairness control.
apiserver_flowcontrol_current_inqueue_seatsNumber of queue "seats" occupied by waiting requests.
apiserver_flowcontrol_current_limit_seatsCurrent limit of total execution seats available for requests.
apiserver_flowcontrol_demand_seats_averageAverage number of seats demanded by incoming requests over time.
apiserver_flowcontrol_demand_seats_high_watermarkHighest observed number of seats demanded by requests.
apiserver_flowcontrol_demand_seats_stdevStandard deviation of request seat demand over time.
apiserver_flowcontrol_dispatch_rDispatch rate of requests under APF scheduling.
apiserver_flowcontrol_dispatched_requestsTotal number of dispatched requests under APF.
apiserver_flowcontrol_priority_level_request_utilizationRatio of utilized vs. available request concurrency per priority level.
apiserver_flowcontrol_priority_level_seat_utilizationUtilization rate of available request execution seats per priority level.
apiserver_flowcontrol_read_vs_write_current_requestsTracks ratio of concurrent read vs. write operations in APF.
apiserver_flowcontrol_request_concurrency_in_useNumber of concurrent requests currently in execution.
apiserver_flowcontrol_request_execution_secondsDuration of request execution for API Priority and Fairness flows.
apiserver_flowcontrol_request_queue_length_after_enqueueQueue length after new requests are enqueued.
apiserver_flowcontrol_request_wait_duration_secondsTime spent by requests waiting in the queue before execution.
apiserver_flowcontrol_seat_fair_fracFraction of seats allocated fairly among competing requests.
apiserver_flowcontrol_target_seatsTarget number of execution seats under APF configuration.
apiserver_flowcontrol_upper_limit_seatsUpper threshold for concurrent execution seats.
apiserver_flowcontrol_watch_count_samplesNumber of watch event samples processed by APF.
apiserver_flowcontrol_work_estimated_seatsEstimated number of seats required per unit of request work.
apiserver_init_eventsInitialization events triggered during API server startup.
apiserver_kube_aggregator_x509_insecure_sha1Count of certificates using insecure SHA1 signatures detected by the aggregator.
apiserver_kube_aggregator_x509_missing_sanNumber of certificates missing Subject Alternative Name (SAN) entries.
apiserver_longrunning_requestsNumber of currently active long-running requests (e.g., watch streams).
apiserver_nodeport_repair_reconcile_errorsErrors encountered during NodePort repair reconciliation.
apiserver_request_abortsNumber of API requests aborted before completion.
apiserver_request_body_size_bytesDistribution of API request body sizes in bytes.
apiserver_request_duration_secondsOverall latency of API requests from receipt to completion.
apiserver_request_filter_duration_secondsTime spent filtering requests by admission or authorization layers.
apiserver_request_post_timeoutNumber of requests that timed out after processing began.
apiserver_request_sli_duration_secondsService Level Indicator (SLI) for request latency duration.
apiserver_request_terminationsNumber of API requests forcefully terminated by the server.
apiserver_request_timestamp_comparison_timeLatency in comparing timestamps during request validation.
apiserver_requestTotal count of API requests received by the server.
apiserver_response_sizesDistribution of response payload sizes returned by the API server.
apiserver_selfrequestInternal requests made by the API server to itself for health or sync operations.
apiserver_storage_data_key_generation_duration_secondsTime taken to generate data encryption keys for storage operations.
apiserver_storage_data_key_generation_failuresNumber of failures during encryption key generation for data storage.
apiserver_storage_envelope_transformation_cache_missesNumber of cache misses during envelope encryption/decryption transformations.
apiserver_storage_events_receivedTotal number of etcd storage events received by the API server.
apiserver_storage_list_evaluated_objectsNumber of objects evaluated by list operations in storage requests.
apiserver_storage_list_fetched_objectsNumber of objects fetched by list operations from etcd storage.
workqueue_work_duration_secondsTime taken by workqueue tasks to complete processing.