Discrepancies in Kubernetes CPU Usage Metrics

이 페이지는 아직 영어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.

As you analyze the CPU usage metrics that Datadog collects from your Kubernetes infrastructure, you may notice discrepancies between Kubernetes metrics (kubernetes.cpu.*) and container runtime metrics (container.cpu.*).

The Datadog Agent collects its metrics from a variety of sources. To collect kubernetes.* metrics, the Datadog Agent makes requests to the kubelet on the same node at a variety of endpoints. These are calculated relative to the metrics that cAdvisor has itself collected and exposed as OpenMetrics formatted data. Specifically, the Agent collects kubernetes.cpu.* metrics from /metrics/cadvisor. CPU measurements are relative to the monotonically increasing counter for CPU time used per container. The Agent’s rate calculations use a slightly different timestamp for the exposed data than the actual timestamp.

Meanwhile, Datadog collects container metrics (such as container.* and docker.*) by communicating with the container runtime sockets and raw cgroup files. These metrics are not impacted by the timestamp discrepancy.

For the most precision, refer to container.cpu.* metrics over kubernetes.cpu.* metrics.