|
| 1 | +--- |
| 2 | +navigation_title: Kubelet stats receiver |
| 3 | +description: The Kubelet stats receiver is an OpenTelemetry Collector component that collects node, pod, container, and volume resource metrics from the Kubernetes Kubelet. |
| 4 | +applies_to: |
| 5 | + stack: |
| 6 | + serverless: |
| 7 | + observability: |
| 8 | + product: |
| 9 | + edot_collector: |
| 10 | +products: |
| 11 | + - id: cloud-serverless |
| 12 | + - id: observability |
| 13 | + - id: edot-collector |
| 14 | +--- |
| 15 | + |
| 16 | +# Kubelet stats receiver |
| 17 | + |
| 18 | +The Kubelet stats receiver collects Kubernetes node, pod, container, and volume metrics directly from the Kubelet API. It is enabled by default in several {{product.observability}} Kubernetes pipelines and is a core component of the {{edot}} Collector distribution. |
| 19 | + |
| 20 | +This receiver queries the Kubelet's `/stats/summary` endpoint and converts the retrieved usage statistics into OpenTelemetry metrics. When configured, it automatically surfaces pre-built dashboards in {{product.observability}} for visualizing node CPU and memory usage, pod throttling, container metrics, and network/filesystem usage. |
| 21 | + |
| 22 | +For full contrib details, refer to the [OpenTelemetry kubeletstats receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/kubeletstatsreceiver). |
| 23 | + |
| 24 | +## Typical use cases |
| 25 | + |
| 26 | +Use the Kubelet stats receiver when you need: |
| 27 | + |
| 28 | +* CPU, memory, network, and filesystem metrics for Kubernetes nodes. |
| 29 | + |
| 30 | +* Fine-grained container CPU/memory usage for workloads running on each node. |
| 31 | + |
| 32 | +* Filesystem and ephemeral storage usage for pods and containers. |
| 33 | + |
| 34 | +* To combine node- and pod-level metrics with logs and traces to troubleshoot performance issues, resource saturation, and pod eviction behavior. |
| 35 | + |
| 36 | +## Configuration |
| 37 | + |
| 38 | +The following example shows a minimal Kubelet stats receiver configuration in an EDOT Collector pipeline. |
| 39 | + |
| 40 | +```yaml |
| 41 | +receivers: |
| 42 | + kubeletstats: |
| 43 | + auth_type: serviceAccount |
| 44 | + collection_interval: 30s |
| 45 | + endpoint: "${KUBELET_ENDPOINT}" # for example: https://$NODE_IP:10250 |
| 46 | + insecure_skip_verify: true # or configure proper TLS |
| 47 | + metric_groups: |
| 48 | + - node |
| 49 | + - pod |
| 50 | + - container |
| 51 | + - volume |
| 52 | + |
| 53 | +processors: |
| 54 | + batch: {} |
| 55 | + |
| 56 | +exporters: |
| 57 | + otlp: |
| 58 | + endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT} |
| 59 | + |
| 60 | +service: |
| 61 | + pipelines: |
| 62 | + metrics: |
| 63 | + receivers: [kubeletstats] |
| 64 | + processors: [batch] |
| 65 | + exporters: [otlp] |
| 66 | +``` |
| 67 | +
|
| 68 | +### Key configuration options |
| 69 | +
|
| 70 | +The following configuration parameters determine how the Kubelet stats receiver interacts with the Kubelet API and which metric groups are collected: |
| 71 | +
|
| 72 | +| Setting | Description | |
| 73 | +|--------|-------------| |
| 74 | +| `auth_type` | Authentication mechanism for talking to the Kubelet. Typically `serviceAccount` when the Collector runs as a DaemonSet. | |
| 75 | +| `endpoint` | The Kubelet’s secure API endpoint, usually `https://<node-ip>:10250`. | |
| 76 | +| `collection_interval` | How frequently the receiver scrapes Kubelet metrics. | |
| 77 | +| `metric_groups` | Controls which metric groups to collect (`node`, `pod`, `container`, `volume`). | |
| 78 | +| `insecure_skip_verify` | Whether to skip TLS certificate verification. For production, configure proper TLS if possible. | |
| 79 | + |
| 80 | +For all available settings, refer to the [contrib configuration documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/kubeletstatsreceiver#configuration). |
| 81 | + |
| 82 | +## How it works in the EDOT Collector |
| 83 | + |
| 84 | +In EDOT, the Kubelet stats receiver is typically used when: |
| 85 | + |
| 86 | +* The Collector is deployed as a DaemonSet, scraping each node’s Kubelet locally. |
| 87 | +* You want per-node and per-pod usage metrics without installing additional agents. |
| 88 | +* The `kubernetes` or `system` metrics pipelines need pod-level resource context. |
| 89 | + |
| 90 | +EDOT applies no custom modifications to the contrib receiver (its behavior is identical to contrib). It is pre-included and validated as supported within the EDOT distribution. |
| 91 | + |
| 92 | +## Example: Collect node and pod metrics in Kubernetes |
| 93 | + |
| 94 | +When you run the EDOT Collector as a DaemonSet, you can enable the Kubelet stats receiver with a minimal configuration like this: |
| 95 | + |
| 96 | +```yaml |
| 97 | +receivers: |
| 98 | + kubeletstats: |
| 99 | + auth_type: serviceAccount |
| 100 | + metric_groups: [node, pod, container] |
| 101 | +``` |
| 102 | + |
| 103 | +This configuration collects: |
| 104 | + |
| 105 | +* Node CPU and memory usage |
| 106 | +* Pod throttling |
| 107 | +* Container memory working set |
| 108 | +* Network and filesystem usage per node, pod, and container |
| 109 | + |
| 110 | +## Caveats and limitations |
| 111 | + |
| 112 | +Consider the following when deploying the Kubelet stats receiver: |
| 113 | + |
| 114 | +* RBAC and TLS must be configured properly. When running as a DaemonSet, the service account usually has the needed permissions. |
| 115 | + |
| 116 | +* Very low `collection_interval` values can increase Kubelet load. |
| 117 | + |
| 118 | +* Metrics for ephemeral containers may not always appear depending on underlying Kubernetes version behavior. |
| 119 | + |
| 120 | +* The receiver scrapes only the local node’s Kubelet when running as a DaemonSet. For centralized scraping, you must expose each node’s Kubelet securely (not recommended). |
0 commit comments