Métriques du serveur d'API Kubernetes
Rapport de recherche Datadog : Bilan sur l'adoption de l'informatique sans serveur Rapport : Bilan sur l'adoption de l'informatique sans serveur

Métriques du serveur d'API Kubernetes

Agent Check Check de l'Agent

Supported OS: Linux Mac OS Windows

Présentation

Ce check surveille Kube_apiserver_metrics.

Configuration

Installation

Le check Kube_apiserver_metrics est inclus avec le paquet de l’Agent Datadog : vous n’avez donc rien d’autre à installer sur votre serveur.

Configuration

Le check Kube_apiserver_metrics est principalement utilisé au niveau des clusters. Consultez la documentation relative aux checks de cluster. Vous pouvez annoter le service de votre apiserver avec ce qui suit :

Annotations:
  ad.datadoghq.com/endpoints.check_names: ["kube_apiserver_metrics"]
  ad.datadoghq.com/endpoints.init_configs: [{}]
  ad.datadoghq.com/endpoints.instances:
    [{ "prometheus_url": "https://%%host%%:%%port%%/metrics", "bearer_token_auth": "true" }]

L’Agent de cluster Datadog programme ensuite le ou les checks pour chaque endpoint sur le ou les Agents Datadog.

Vous pouvez également exécuter le check en configurant directement les endpoints dans le fichier kube_apiserver_metrics.d/conf.yaml, dans le dossier conf.d/ à la racine du répertoire de configuration de votre Agent. Consultez le fichier d’exemple kube_apiserver_metrics.d/conf.yaml pour découvrir toutes les options de configuration disponibles.

Par défaut, l’Agent qui exécute le check essaie d’obtenir le token de porteur du compte du service dans le but d’effectuer l’authentification auprès de APIServer. Si vous n’utilisez pas de système RBAC, définissez bearer_token_auth sur false.

Enfin, si vous exécutez l’Agent Datadog sur les nœuds principaux, vous pouvez faire appel à Autodiscovery pour programmer l’exécution du check. Si vous exécutez l’image officielle k8s.gcr.io/kube-apiserver, cette opération s’effectue automatiquement.

Validation

Lancez la sous-commande status de l’Agent et cherchez kube_apiserver_metrics dans la section Checks.

Données collectées

Métriques

kube_apiserver.longrunning_gauge
(gauge)
Gauge of all active long-running apiserver requests broken out by verb API resource and scope. Not all requests are tracked this way.
Shown as request
kube_apiserver.current_inflight_requests
(gauge)
Maximal number of currently used inflight request limit of this apiserver per request kind in last second.
kube_apiserver.audit_event
(gauge)
Accumulated number audit events generated and sent to the audit backend
Shown as event
kube_apiserver.go_threads
(gauge)
Number of OS threads created
Shown as thread
kube_apiserver.go_goroutines
(gauge)
Number of goroutines that currently exist
kube_apiserver.APIServiceRegistrationController_depth
(gauge)
Current depth of workqueue: APIServiceRegistrationController
kube_apiserver.etcd_object_counts
(gauge)
Number of stored objects at the time of last check split by kind
Shown as object
kube_apiserver.rest_client_requests_total
(gauge)
Accumulated number of HTTP requests partitioned by status code method and host
Shown as request
kube_apiserver.apiserver_request_count
(gauge)
Accumulated number of apiserver requests broken out for each verb API resource client and HTTP response contentType and code (deprecated since kubernetes 1.15)
Shown as request
kube_apiserver.apiserver_dropped_requests_total
(gauge)
Accumulated number of requests dropped with 'Try again later' response
Shown as request
kube_apiserver.http_requests_total
(gauge)
Accumulated number of HTTP requests made
Shown as request
kube_apiserver.authenticated_user_requests
(gauge)
Accumulated number of authenticated requests broken out by username
Shown as request
kube_apiserver.audit_event.count
(count)
Monotonic count of audit events generated and sent to the audit backend
Shown as event
kube_apiserver.rest_client_requests_total.count
(count)
Monotonic count of HTTP requests partitioned by status code method and host
Shown as request
kube_apiserver.apiserver_request_count.count
(count)
Monotonic count of apiserver requests broken out for each verb API resource client and HTTP response contentType and code (deprecated since kubernetes 1.15)
Shown as request
kube_apiserver.apiserver_dropped_requests_total.count
(count)
Monotonic count of requests dropped with 'Try again later' response
Shown as request
kube_apiserver.http_requests_total.count
(count)
Monotonic count of the number of HTTP requests made
Shown as request
kube_apiserver.authenticated_user_requests.count
(count)
Monotonic count of authenticated requests broken out by username
Shown as request
kube_apiserver.apiserver_request_total
(gauge)
Accumulated number of apiserver requests broken out for each verb API resource client and HTTP response contentType and code (Only present from kubernetes 1.15 to replace apiserver_request_count)
Shown as request
kube_apiserver.apiserver_request_total.count
(count)
Monotonic count of apiserver requests broken out for each verb API resource client and HTTP response contentType and code (Only present from kubernetes 1.15 to replace apiserver_request_count.count)
Shown as request
kube_apiserver.rest_client_request_latency_seconds.sum
(gauge)
Request latency in seconds broken down by verb and URL
Shown as second
kube_apiserver.rest_client_request_latency_seconds.count
(count)
Request latency in seconds broken down by verb and URL count
kube_apiserver.admission_webhook_admission_latencies_seconds.sum
(gauge)
Admission webhook latency identified by name and broken out for each operation and API resource and type (validate or admit)
Shown as second
kube_apiserver.admission_webhook_admission_latencies_seconds.count
(count)
Admission webhook latency identified by name and broken out for each operation and API resource and type (validate or admit) count
kube_apiserver.admission_step_admission_latencies_seconds.sum
(gauge)
Admission sub-step latency broken out for each operation and API resource and step type (validate or admit)
Shown as second
kube_apiserver.admission_step_admission_latencies_seconds.count
(count)
Admission sub-step latency histogram broken out for each operation and API resource and step type (validate or admit) count
kube_apiserver.admission_step_admission_latencies_seconds_summary.sum
(gauge)
Admission sub-step latency summary broken out for each operation and API resource and step type (validate or admit)
Shown as second
kube_apiserver.admission_step_admission_latencies_seconds_summary.count
(count)
Admission sub-step latency summary broken out for each operation and API resource and step type (validate or admit) count
kube_apiserver.admission_step_admission_latencies_seconds_summary.quantile
(gauge)
Admission sub-step latency summary broken out for each operation and API resource and step type (validate or admit) quantile
Shown as second
kube_apiserver.admission_controller_admission_duration_seconds.sum
(gauge)
Admission controller latency histogram in seconds identified by name and broken out for each operation and API resource and type (validate or admit)
Shown as second
kube_apiserver.admission_controller_admission_duration_seconds.count
(count)
Admission controller latency histogram in seconds identified by name and broken out for each operation and API resource and type (validate or admit) count

Checks de service

Kube_apiserver_metrics n’inclut aucun check de service.

Événements

Kube_apiserver_metrics n’inclut aucun événement.

Dépannage

Besoin d’aide ? Contactez l’assistance Datadog.