Collecting Kubernetes cluster and node metrics with OpenTelemetry
A platform team that needs node, pod and container resource metrics alongside the state of cluster objects can build both into one OpenTelemetry pipeline, but the two halves come from different sources. The kubeletstats receiver runs in each node's agent and reads resource usage from the kubelet on that node, covering CPU, memory, filesystem and network figures for nodes, pods and containers. The Kubernetes cluster receiver works differently: it runs once per cluster and reads object state from the Kubernetes API server, such as pod phase, deployment replica counts, node conditions and namespace-level status. Because these receivers need different reach, the usual split is a DaemonSet agent for kubeletstats and a single Deployment instance for the cluster receiver, so cluster-wide counts are not reported once per node.
Both receivers need Kubernetes RBAC permissions to read the resources they query, and the kubelet connection needs a decision about authentication and TLS before anything is scraped. Confirm with your cluster administrator which kubelet endpoint and certificate settings your distribution uses, and confirm that the service accounts bound to each Collector role can only list and watch the objects you intend to collect. Check the receiver READMEs for the metric names and stability levels of the version you deploy, since these change between Collector releases.
OpenTelemetry is not a storage backend. The Collector receives and exports these metrics, but it does not keep a history or provide query and alerting features, so you need a separate system such as Prometheus, a managed metrics service or another compatible backend to store and query them. Decide that backend before rollout, confirm how it accepts OTLP or Prometheus-format data from the Collector, and size retention for the cardinality that pod-level metrics create. Two alternatives may already run in your environment: kube-state-metrics for object state and cAdvisor scraping for container resource metrics. Compare what each exposes with what the receivers produce before you retire either one.
How kubelet and API server data reach the Collector
The flow starts at the kubelet on each node, which the kubeletstats receiver in a DaemonSet Collector scrapes for node, pod and container figures. A separate single-replica Deployment Collector runs the Kubernetes cluster receiver, which reads object state from the Kubernetes API under its own service account. Both paths pass through processors such as k8sattributes before one exporter sends data to a separate metrics backend. Check that each service account holds only the read permissions its receiver needs, and that the backend sits outside the cluster trust boundary.
Node and cluster-level metric paths into one exporter.
kubeletstats, kube-state-metrics and cAdvisor compared
The kubeletstats receiver calls the kubelet on each node and reads resource usage for nodes, pods and containers, including CPU, memory, filesystem and network figures that the kubelet already tracks. Because it reads a per-node endpoint, it is usually deployed as a DaemonSet so that each agent collects only from the kubelet on its own node. It reports what workloads consume, not the desired state of objects, so it can show a container's memory use but cannot tell you whether a Deployment has its intended replica count.
- Where it runs: one agent per node, with the service account permissions needed to reach the kubelet endpoint and read node and pod stats.
- What it exposes: resource usage at node, pod and container level. Confirm the exact metric names and which ones are enabled by default in the receiver README.
- Overlap: the same CPU and memory figures can also arrive through cAdvisor scraping, so pick one path for each signal.
- Gap: no view of object state, such as pending pods, replica counts or failed Jobs.
- Authentication: kubelet TLS and authentication settings vary by distribution, so confirm them in your environment before you rely on the defaults.
Check that each node appears once in your backend and that the node count matches the cluster.
The Kubernetes cluster receiver watches the Kubernetes API server and emits metrics about cluster-level object state, such as the condition and count of nodes, pods and workload objects. It describes what the cluster has been asked to run and how that state is changing, not how much CPU or memory any container is using. Because it reads cluster-wide state, it is normally run as a single instance in a Deployment, so that one collector owns the view of the whole cluster.
- Where it runs: a single replica, outside the node-level agents, with read access to the object types it reports on.
- What it exposes: object state and conditions for the Kubernetes resource types enabled in its configuration. Confirm which resource types and metrics it emits in the receiver README.
- Overlap: its object-state metrics overlap with kube-state-metrics, so running both usually doubles those series.
- Gap: no container resource usage, which must come from kubeletstats or cAdvisor.
- Scaling risk: running more than one replica without a sharding plan duplicates series and load on the API server.
Check that exactly one instance is active and that its RBAC allows list and watch only on the resource types you have chosen to collect.
kube-state-metrics is a separate open-source project that listens to the Kubernetes API and exposes metrics about object state in a format that Prometheus-compatible scrapers can read. Many teams already run it and have dashboards and alert rules written against its metric names. A Collector can scrape it with the Prometheus receiver, which keeps those existing names and queries working while you move collection to OpenTelemetry. It runs as a workload in the cluster, so the scrape target is a Service endpoint, not a node.
- Where it runs: a Deployment in the cluster, scraped by a Collector that has network access to its Service.
- What it exposes: object state, similar in scope to the cluster receiver. Confirm the metric names and version-specific changes in the kube-state-metrics release notes before you write alert rules.
- Overlap: if the cluster receiver is also enabled, you will get two sets of object-state series, so choose one.
- Naming trade-off: keeping kube-state-metrics names preserves dashboards, but mixing these names with OpenTelemetry semantic conventions can make cross-signal queries harder.
- Gap: no node or container resource usage.
Check that the scrape job runs on a single replica or through a target allocation method that prevents duplicate scrapes.
cAdvisor is the container resource monitor built into the kubelet. It reports container-level CPU, memory, filesystem and network usage and is exposed by the kubelet on its own metrics path. Because the data is produced on each node, a Collector must scrape every kubelet individually, which makes cAdvisor scraping a per-node job. It shows what each container consumes, but it carries no object state and its labels depend on the container runtime, so pod and namespace context usually has to be added afterward.
- Where it runs: each node's kubelet is the source, so the scrape must reach every node, usually through a DaemonSet collector or node-aware discovery.
- What it exposes: container resource and filesystem metrics. Confirm the metric names and label sets for your kubelet version in the Kubernetes and receiver documentation.
- Overlap: container CPU and memory overlap with kubeletstats. Running both doubles those series.
- Labels: pod and namespace attributes may be missing or named differently, so plan for the Kubernetes attributes processor.
- Gap: no object state such as replica counts or scheduling failures.
Check for series that appear twice with identical values, since that usually means two sources are enabled for the same signal.
Receiver and deployment options and when each fits
This table compares the main receiver and deployment choices for node and cluster metrics: kubeletstats in DaemonSet mode, the Kubernetes cluster receiver in a single replica, kubelet and API authentication, and interval and metric group settings. Read each row as a decision you make before writing the Collector configuration, and confirm the exact option names against the receiver README for your Collector version.
| Option | What it controls | When it fits | Trade-off |
|---|---|---|---|
| kubeletstats in DaemonSet mode | Runs one Collector per node that reads container, pod and node resource metrics from that node's kubelet | Node-level CPU, memory, filesystem and network metrics for every node, with each Collector scraping only its local kubelet | One agent runs on every node, so its resource use and RBAC scope apply cluster-wide |
| Kubernetes cluster receiver in a single replica | Watches cluster object state through the API server, such as deployments, pods and node conditions | Cluster-level object metrics that should be reported once, not once per node | Running more than one replica can duplicate data, so the deployment must stay at one instance unless the receiver docs say otherwise |
| kubelet authentication mode | How the Collector proves its identity to the kubelet endpoint, such as service account token or client certificate settings | Clusters where the default kubelet settings are accepted and the agent's service account is allowed to read node stats | Looser kubelet authentication may be rejected by hardened clusters, so confirm the mode each node expects |
| API server authentication | How the cluster receiver authenticates to the Kubernetes API for list and watch calls | Clusters where the Collector runs under a service account with read-only RBAC on the object types it collects | Broad read permissions widen what the Collector can see, so scope RBAC to the resources you report on |
| Collection interval | How often the receiver scrapes kubelets or the API | Short intervals for node pressure alerts, longer intervals where cost or API load is a concern | Shorter intervals raise data volume and kubelet or API load, and should be tested on your largest nodes |
| Metric groups | Which resource families are reported, such as container, pod, node or volume metrics | Limiting output to the groups your dashboards and alerts use | Turning groups off may hide data that later troubleshooting needs, so record the choice and confirm names in the README |
Setting up node and cluster metrics collection
This sequence takes a Kubernetes cluster from an unconfigured state to a verified pipeline that collects node, pod and container metrics from kubelets, plus cluster-level object state, and tags every data point with cluster and workload identity. Each step ends with a check so the team knows it can move on.
Confirm the Collector distribution and version
The platform team selects the Collector distribution and version before any manifests are written. Releases are published on the OpenTelemetry Collector releases page, and each release ships the contrib distribution with signed artifacts, SHA256 checksums and SBOM files, which the team should verify on download. Build a custom image with the Collector Builder only if the team wants to keep the component set minimal, and confirm that the kubeletstats, k8sattributes and Kubernetes cluster receivers are included in the chosen build. Done when the team has a pinned image tag, a checksum record, and a written list of the receivers and processors the build contains.
Choose DaemonSet and Deployment placement
Split the work by collection target. Node-level receivers, such as kubeletstats, need an agent on every node, so they run in a DaemonSet that reads each kubelet locally. Cluster-level receivers, such as the Kubernetes cluster receiver, read object state from the API server and must run as a single logical instance, so they run in a Deployment with one replica to avoid duplicate series. Document this split in the deployment design, including who owns each workload. Done when the design names both workloads, their replica model, and the node pools they will schedule on.
Create service accounts and RBAC for kubelet and API reads
Create one service account for the node agent and one for the cluster receiver, and bind each to a ClusterRole that grants only the reads its receivers need. The node agent needs access to node stats and the kubelet API, and the cluster receiver needs list and watch access to the object kinds it reports on. Restrict the cluster role to those resources and verbs, and review it with the cluster administrator. Confirm the kubelet authentication mode with the cluster owner before applying the binding, because it determines whether the agent needs a token or certificate. Done when
kubectl auth can-ireturns the expected results for each service account and each denied action.Configure the kubeletstats and cluster receivers
In the agent configuration, add the kubeletstats receiver and set its endpoint to the node's kubelet, with the metric groups limited to node, pod and container data that the team has agreed to collect. In the cluster receiver configuration, enable the Kubernetes cluster receiver for the object types in scope and set its collection interval. Keep the two receivers in separate pipelines so their failures and volumes can be read separately. Review the receiver READMEs for stability levels before enabling each metric group, because stability differs across components. Done when both Collector workloads start without errors and the logs show each receiver reporting a successful first scrape.
Add k8sattributes and cluster identity attributes
Add the k8sattributes processor to the metrics pipelines so that each data point carries namespace, pod, deployment and node labels that match the workload. Pair its pod association rules with the metric source, and confirm the agent's service account can read the pods it annotates. Then add a resource processor that sets a stable cluster identifier, such as
k8s.cluster.name, on every metric, so that data from several clusters can be separated later. Agree the cluster name with the team that owns the backend, because it must be unique and stable. Done when a sample metric from the debug output shows both the Kubernetes attributes and the cluster identifier.Export metrics to a backend
Configure an exporter that sends the metrics to the team's chosen backend, using the endpoint and credentials agreed during the backend design. Keep credentials in Kubernetes Secrets or an external secret store rather than in the Collector configuration file, and confirm that the exporter uses encryption in transit. If the backend requires authentication, use a Collector authenticator extension such as oauth2client where the backend supports it. Done when the exporter reports successful sends in the Collector's own telemetry and the backend shows incoming data points from the agent and the cluster receiver.
Verify with the debug exporter and a metric query
Add a debug exporter to one pipeline temporarily and inspect the output for the expected metric names, resource attributes and cluster identifier. Then remove the debug exporter from production, or keep it only in a test environment, because verbose output carries cost and can expose sensitive data. Finally, run a query in the backend that compares node CPU or memory from the kubelet with a known workload and confirms that both the pod and container series appear once per node. Also check that cluster-level object counts match
kubectloutput. Done when the query results agree with the cluster state, and the team records the metric names, query and cluster identifier in the runbook.
How the receivers avoid duplicate and missing series
The core risk in this section is that the same metric series arrives twice or never arrives at all, and both failures come from unclear ownership. A kubeletstats receiver running in a DaemonSet reads container and pod metrics from each node's kubelet, so every node reports its own pods. If a second scraper, such as a Prometheus job, a cAdvisor scrape or a sidecar collector, also collects the same container metrics, the backend stores two copies of each series with near-identical labels, and dashboards and alerts double-count without any error being raised. The fix is to decide, for each metric family, exactly one collection path and to remove the others from the Collector configuration and from any existing Prometheus scrape configs.
Node-scoped collection maps naturally to pods because each DaemonSet instance only talks to its local kubelet. The receiver reports pod and container data for the node it runs on, so the k8s.node.name value must be set correctly, typically through the K8S_NODE_NAME environment variable populated from the downward API. Cluster-level state, such as deployment replica counts, pod phase or node conditions, is different: the Kubernetes cluster receiver reads the API server and returns the same objects no matter where it runs. Running it in every DaemonSet pod would multiply those series by node count, so it should run as a single replica in a Deployment. Confirm the replica count and the RBAC role bindings for both receivers with a dry-run render of your Helm values before rollout.
Before relying on the numbers, assign a named owner to each metric family, such as node CPU and memory, container resource usage, and object state, and record it in the deployment repository. Then compare series counts in your backend against expectations: count series per k8s.node.name and per k8s.cluster.name, check that each pod appears once, and confirm that a deployment's replica metric matches kubectl get deployment output. Missing series often show up as gaps after an RBAC or node selector change, so repeat these checks after each Collector upgrade. The exact metric names and resource attributes vary by Collector version, so verify them against the receiver README in your pinned release rather than assuming them.
Security and operational considerations for node metrics
Node and cluster metrics pipelines read sensitive surfaces: kubelet endpoints, cluster object state and the labels that flow into your back end. The cards below cover the decisions that keep that access narrow, the Collector itself observable, and the telemetry it emits free of data you never meant to store.
Least-privilege RBAC for stats and list-watch
The Kubeletstats receiver needs read access to node and pod stats, and the Kubernetes cluster receiver needs list and watch on objects such as pods, nodes, namespaces and deployments. Grant those verbs on those resources only, bind the role to a dedicated service account per receiver mode, and avoid cluster-admin shortcuts copied from examples. Check the bindings with a permissions review before the first deployment, and repeat the check whenever a new receiver or resource type is added.
Pod Security StandardsKubelet authentication and TLS settings
Decide how the Collector authenticates to each kubelet and whether it verifies the kubelet certificate. Service account token authentication with a verified CA is the stronger default; skipping TLS verification to get a first run working tends to persist into production. Confirm the kubelet's authentication and authorization mode with your distribution's documentation, and confirm that the read-only kubelet port is not exposed on the node network.
Collector endpoints and secrets
Since v0.110.0, Collector server components bind to localhost by default instead of 0.0.0.0, so any receiver you open to other pods or nodes must be set explicitly and paired with authentication. Keep exporter credentials and tokens in Kubernetes Secrets or an external store, not in the Collector configuration file, and restrict who can read the ConfigMap. Review every listening port in the rendered configuration after each Helm upgrade.
Redacting sensitive labels
Node and pod metadata can carry values you do not want in a metrics back end, such as internal hostnames, owner emails in annotations or tenant identifiers in labels. Use the redaction processor and attribute filtering to remove or hash those keys before export, and list the allowed resource attributes explicitly. Test the pipeline with a sample of real object labels in a non-production cluster, and record which keys were dropped so auditors can trace the decision.
Minimal contrib builds with the Collector Builder
The contrib distribution includes many receivers and processors that a node metrics pipeline never uses, and each unused component is extra code to patch and review. Build a custom Collector with the Collector Builder that includes only the kubeletstats, Kubernetes cluster, batch, memory limiter and exporter components you run. Verify the image against the signed artifacts, checksums and SBOM published with each release before it reaches the cluster.
Collector releasesCollector self-monitoring and alignment with CIS
A node metrics pipeline that silently fails leaves cluster gaps nobody sees. Enable the Collector's own internal telemetry, alert on refused or dropped data, and watch memory limiter activity and restart counts. Map the Collector's pod settings, such as privilege, host paths and capabilities, against the CIS Kubernetes Benchmark, and use the Pod Security Standards to set the namespace baseline so the agent runs with the fewest privileges it needs.
What drives the cost and effort of this rollout
The largest cost of a cluster and node metrics rollout is usually the Collector itself, running on every node. The kubeletstats receiver is read from each kubelet, so the Collector usually runs as a DaemonSet, and its CPU and memory use grows with the number of pods and containers on that node. The cluster receiver adds a separate, single-instance workload that watches cluster-level object state through the Kubernetes API. Ask any partner or vendor to state the resource requests and limits they plan for each mode, how they scale with pod density, and which pipelines run in the agent versus a gateway. Metrics storage is the second recurring cost. Every additional series, label and scrape interval increases the load on the back end, so the quote should name the retention period, the storage system and who operates it, whether that is your Prometheus, a remote-write target or a managed service.
Staff time is the cost most often missed in estimates. Someone must review the ClusterRole and ServiceAccount the receivers need, confirm which resources and verbs are granted, and record why each is required, because these permissions read cluster state across namespaces. Dashboards and alert rules built on kube-state-metrics or cAdvisor names will need rework when the metric names, attributes and resource labels change, so budget for an inventory of existing queries and a test against the new series before the old ones are retired. Plan for running both sources side by side for a period to compare values. Confirm the exact metric names against the Collector release you deploy, since receiver metric definitions can change between versions.
Ongoing Collector upgrades recur for as long as the pipeline runs. The Collector releases new versions frequently, and the Collector repository publishes signed artifacts, checksums and SBOMs that your change process should verify on each upgrade. Upgrades also touch RBAC, because a new receiver version may need additional permissions, and the security team should review those changes. Ask a partner to specify who performs upgrades, how often, how they test against a staging cluster, and whether support covers the Collector builds you use. One-time costs cover design, initial RBAC review, dashboard migration and the first rollout. Recurring costs cover node resources, metrics storage, upgrades, RBAC re-review and alert maintenance. Request a quote that separates these, and that names the Kubernetes versions you run, since the supported minor versions shape how long a given Collector configuration remains valid.
Questions buyers ask about cluster and node metrics with OpenTelemetry
Can kube-state-metrics be retired after moving to OpenTelemetry?
Sometimes, but it depends on what your dashboards, alerts and recording rules read today. The Kubernetes cluster receiver collects object state (deployments, pods, nodes, replica sets and similar) and emits metrics that overlap with much of what kube-state-metrics exposes, but the metric names, labels and resource coverage are not identical. Before removing kube-state-metrics, inventory every query and alert that depends on it, map each one to the OpenTelemetry metric that replaces it, and run both pipelines in parallel long enough to compare results. Confirm current metric names and receiver options against the Collector component README for the release you deploy, because component stability varies across the project.
How long does a cluster and node metrics rollout take, and what drives it?
The duration depends mainly on the number of clusters, how many dashboards and alerts must be remapped, and how much of the existing monitoring stack is being replaced rather than extended. A single cluster with a standard Helm deployment and a short list of dashboards is a much smaller job than a multi-cluster estate with custom alert rules and strict change control. Other drivers include RBAC approval for the service account that reads kubelet and API state, the number of node pools with different operating systems, and the parallel-run period needed to validate metric parity. Ask any provider to break the timeline into discovery, build, parallel run and cutover, and to state which of those steps depend on your change windows.
What does the work need from our platform team?
Your team needs to provide cluster access in the environment where the Collector will run, a named owner for the service account and RBAC approval, and a list of the dashboards, alerts and consumers that read today's metrics. You also need someone who can approve the Collector image source and version, since release artifacts are published with signed files, SHA256 checksums and SBOMs that should be verified during intake. Kubelet access settings, network policy between the Collector and each node, and the metrics backend endpoint must be decided with your platform and security teams. Without these inputs, rollout stalls at the review stage regardless of how well the pipeline itself is built.
Can an internal team build this alone?
A team with strong Kubernetes operations skills and time to read the Collector component documentation can build a basic cluster and node metrics pipeline in-house. The harder parts are usually the ones that look small: reading kubelet metrics securely, avoiding duplicate series when several agents report the same node, deciding which resource attributes to keep, and validating that the new metrics match the old ones before anyone turns off the old pipeline. Teams often underestimate how much time parallel validation and dashboard remapping take. DeployOpen implements these pipelines in your infrastructure under a written, fixed scope, so you can compare that option against your own capacity and the cost of a delayed cutover.
What drives the cost, and what should we ask for in a quote?
Cost has two parts: one-time implementation work and recurring operation. The one-time work covers discovery, Helm or Operator deployment, receiver and processor configuration, RBAC, dashboard and alert remapping, and validation. Recurring costs include the Collector upgrade cadence, infrastructure to run the pipeline and store metrics, and the people who respond to pipeline failures. The OpenTelemetry Collector itself is Apache-2.0 licensed, so software licensing is not usually the cost driver. Ask for a quote that lists the clusters in scope, the number of dashboards and alerts to migrate, the parallel-run period, what is excluded (such as new backend work), and how upgrades after handover are priced.
Does Prometheus remain necessary if we use OpenTelemetry?
OpenTelemetry is not an observability backend, so it does not store or query metrics by itself. Prometheus is open source under Apache-2.0 and is commonly used as the storage and query layer, with PromQL for alerting and dashboards. Whether you keep it depends on what you already run and what you need from it. A Prometheus server stores data locally by default, is not clustered or replicated, and is a single-node database to operate, so teams often pair it with remote write to long-term storage. Alternatively, the Collector can export to another backend. Decide the storage layer first, then confirm the exporter and query path with the vendor or project documentation.
What should we check about security before enabling kubelet and cluster metrics?
Reading kubelet and API metrics requires credentials and network access that can expose cluster state, so review them before deployment. Check the service account permissions the receivers need and keep them read-only and scoped to what the receivers use. Confirm how the Collector authenticates to the kubelet and API server, and whether any component listens on a network interface. Collector releases since v0.110.0 bind server components to localhost by default rather than 0.0.0.0, but any change you make to that setting must be reviewed. Apply the redaction processor to remove sensitive attributes, and document these decisions so your security team can review them.
Official sources for the receivers and Collector
Start with the Collector configuration docs before writing any kubeletstats or k8s_cluster block. The configuration reference explains how receivers, processors and exporters are wired into pipelines, and it is the place to confirm how the Collector expects these components to be declared. Treat the page as the map for the rest of this topic, then check each receiver's own README in the Collector repository for its stability level, required settings and supported metric names, because stability differs between components and between Collector releases.
The OpenTelemetry Collector on GitHub repository holds the core code and is the authoritative source for the component list behind your build. Before you choose a distribution, confirm that the receivers you need ship in it, and check the release notes for renamed options or metric changes since the version you plan to run. Pin the Collector version in your Helm values or Operator manifests and record which release you tested, so that an upgrade does not silently change metric names your dashboards depend on.
Kubernetes side settings also need a source of truth. Read the Kubernetes version skew policy to confirm which kubelet and API server versions your cluster can run, since the kubelet stats endpoint and the object watches that the cluster receiver uses depend on those versions. Confirm the supported API versions for your cluster with your platform team and test the receiver against a non-production cluster at the same minor version before rollout, because an unsupported combination is easiest to catch in a lab and hardest to explain once dashboards go dark.
How DeployOpen scopes and delivers Kubernetes metrics collection
DeployOpen plans, builds, documents and supports Kubernetes cluster and node metrics pipelines with OpenTelemetry inside the infrastructure you control. Engagements start with a written scope that names the clusters, receivers, back ends and RBAC boundaries involved, so your security and platform teams can review the design before any work begins.
How we scope
- Inventory of clusters, distributions, Kubernetes versions and the kubelet endpoints each node exposes
- Agreed list of receivers, cluster-level object metrics and the metric names your dashboards and alerts depend on
- Written RBAC, network path and cost assumptions for the Collector, agreed with your platform team before work starts
How we build
- Collector deployment in the mode that fits your design, configured with the Kubeletstats and Kubernetes cluster receivers
- Built-in review of Collector configuration against OpenTelemetry security guidance, including secure storage and localhost binding
- Test runs that compare collected node, pod and container metrics with values your current tooling reports for the same workloads
How we hand over
- Documentation of the pipeline, service accounts, ClusterRole bindings, configuration keys and upgrade procedure for your team
- Runbook covering dropped metrics, Collector restarts and memory pressure, with the checks your operators should run
- Knowledge transfer sessions with the engineers who will own the pipeline after handover
How we support
- Fixed-scope engagements, with scope, deliverables and timelines agreed in writing before work starts
- Ongoing support, Collector upgrades and continuous testing available as a retainer after handover
- Review of each new Collector release for component stability changes that affect your cluster metrics pipeline

