Kubernetes observability with OpenTelemetry

How to collect traces, metrics and logs from self-managed Kubernetes with OpenTelemetry, from Collector topology to enrichment, auto-instrumentation and secured export. Scope and effort depend on your environment.

On this page

Kubernetes observability with OpenTelemetry: what the integration does

A platform team running self-managed Kubernetes clusters needs traces, metrics and logs from its workloads and from the cluster itself, and it needs them without tying every service to one vendor's agent or one storage product. OpenTelemetry separates the two jobs. Its SDKs and auto-instrumentation generate and export telemetry, and the OpenTelemetry Collector receives, processes and forwards it to whichever backends the organization chooses. OpenTelemetry is not a storage or visualization backend. Traces, metrics and logs still need a system that keeps them and a tool that lets engineers query them, so the backend choice is a separate decision that should be made with the same care as the collection design.

On Kubernetes, the supported way to run this is the OpenTelemetry Operator, which manages Collector deployments and instrumentation through custom resources. The design choice that shapes the rest of the work is the split between agent and gateway Collectors. Agent Collectors run close to the workloads, usually as a DaemonSet, and collect node and pod-level data. Gateway Collectors run as a central deployment that receives data from many sources and applies shared processing and export settings. Most platforms use both, but the team should decide which signals pass through which tier, where Kubernetes metadata is attached and who owns each Collector configuration before anything is deployed. Confirm the Operator release and the Collector image your organization will pin, since the Collector ships frequent releases and each component carries its own stability level documented in its README.

Before committing to a design, confirm three things with the team that will run it: which backends must receive the data and whether they accept OTLP directly, which namespaces and workloads need auto-instrumentation and in which languages, and how Collector endpoints will be authenticated. The Collector can authenticate incoming connections with extensions such as OIDC and add credentials to outgoing exporter requests, so access control for telemetry is a configuration decision rather than an afterthought. Those answers determine the cost and effort of the integration more than the Operator installation does, and they are the questions to put in front of any implementation partner before a scope is agreed.

What you need before installing the OpenTelemetry Operator

The Operator, the Collector and the backend all depend on decisions made before the first install. Settle the cluster access, certificate handling, backend endpoint, network paths and Collector distribution up front, so the install does not stall on a missing dependency.

Cluster version and admin access

Confirm the Kubernetes version of the target cluster against the Operator and Collector releases you plan to run, and check the version skew rules for your nodes. The installer needs cluster-scoped rights to create CRDs, the Operator deployment, RBAC objects and admission webhooks. Ask who holds that access and whether a platform team must approve cluster-wide changes. Record the cluster name and version in the deployment plan.

Version skew policy

Certificate management for the webhook

The Operator uses admission webhooks to validate and mutate resources, and the API server must reach them over TLS. Decide whether certificates come from cert-manager, your internal certificate authority or a manual process, and who renews them. Expired webhook certificates block resource changes cluster-wide, so set renewal ownership before go-live. Confirm the chosen method against the Operator release notes for your version.

A chosen backend and its credentials

OpenTelemetry does not store or display telemetry, so you need a backend that accepts traces, metrics or logs before the Collector can export anything. Record the endpoint, protocol, tenant or index and the authentication method it requires. Store the credentials in your secrets platform rather than in Collector configuration, and confirm the Collector component that supports your authentication scheme.

Network paths from nodes to the gateway

Agent Collectors on each node must reach the gateway, and the gateway must reach the backend. Map each path, the ports and the protocols, and check any firewall, network policy or egress proxy between them. Confirm whether pods can reach the Collector service by name and whether egress to a SaaS or external backend is allowed from the cluster network. Document these paths before writing exporter settings.

Contrib distribution and release artifacts

The Collector release pages ship the contrib distribution with signed artifacts, SHA256 checksums and SBOM files, alongside the builder and OpAMP supervisor. Choose the distribution your pipelines need, then verify signatures and checksums against the release before pulling images into your registry. Keep the SBOM with the image record so your security team can answer component questions later. Confirm the exact Collector version against the release list, since the newest release is not always the one your Operator supports.

Latest Collector release
v0.163.0
Collector release list

Configuring the Collector topology in sequence

This sequence takes a cluster from no telemetry pipeline to a tested path in which workloads send traces, metrics and logs through Collectors that attach Kubernetes metadata and export with authentication. Each step ends with a check so the next layer is built on verified ground.

  1. Install the OpenTelemetry Operator

    The platform team installs the OpenTelemetry Operator and its prerequisites into a dedicated namespace, using the release and install method that match your cluster policy. Confirm the release you install against the OpenTelemetry Collector releases page and your Kubernetes version before you start. The step is done when the Operator deployment is ready and its custom resource definitions for Collector and Instrumentation objects are registered, which you can confirm by listing those resources with kubectl.

  2. Choose agent and gateway Collector roles

    Decide which telemetry runs through a node-level agent deployed as a DaemonSet and which runs through a central gateway deployed as a Deployment. Agents suit node and pod-local collection such as container logs and host metrics, while gateways suit batching, sampling, tail-based decisions and export credentials kept in one place. Record the decision per signal in a short design note that your security reviewers can read. The step is done when the agreed topology is written down and each signal has a named owner.

  3. Define OTLP and Kubernetes receivers

    Configure receivers on each Collector role: OTLP over gRPC and HTTP for application telemetry, and Kubernetes-specific receivers for cluster objects and container logs where the role needs them. Bind the OTLP endpoints to the cluster network intentionally, since the Collector configuration best practices page recommends limiting which interfaces receive data. The step is done when the rendered Collector configuration validates and a test client can reach the OTLP port from inside the cluster, which you can confirm with a short port check from a debug pod.

  4. Add the k8sattributes processor and its RBAC

    Add the k8sattributes processor to the agent pipelines so spans, metrics and logs carry pod, namespace, deployment and node labels. The processor reads cluster metadata through the Kubernetes API, so create a ServiceAccount, a ClusterRole limited to the read verbs and resources it needs, and a binding for the Collector. Do not grant broader permissions to make a test pass. The step is done when Collector logs show no permission errors and a sample record carries the expected resource attributes.

  5. Configure exporters with authentication

    Set exporters for each backend and attach credentials through Collector authenticator extensions. Use an OIDC-based authenticator on receivers where clients must prove identity, and the oauth2client extension where the exporter must present a token to the backend. Store client secrets in Kubernetes Secrets or your secrets platform and reference them rather than writing them into the Collector manifest. The step is done when the exporter reports successful sends and the backend rejects a request made without credentials.

  6. Deploy Instrumentation resources for chosen languages

    Create Instrumentation resources for the languages your teams run, and annotate the target namespaces or workloads so the Operator injects the matching auto-instrumentation. Confirm each language's support status in the OpenTelemetry status page, because trace SDK maturity and log SDK maturity differ by language. Agree with application owners which workloads opt in and how they roll back. The step is done when an annotated pod restarts with the injected agent and its startup logs show the instrumentation loaded.

  7. Validate with a test workload

    Deploy a small test workload in an isolated namespace, generate requests through it, and follow one trace from the application to the gateway and into the backend. Check that the trace carries the Kubernetes attributes added by the processor and that metrics and logs from the same workload arrive as expected. Confirm that Collector pods report ready and that dropped or refused data counters stay at zero. The step is done when a test span is visible in the backend with its Kubernetes context, and the result is recorded for the operations runbook.

Daemonset or gateway: choosing where Collectors run

An agent Collector runs as a DaemonSet, so one copy lands on every node. It sits close to the workloads it observes and can collect node-level and container-level data, such as host metrics and container logs, as well as traces and metrics sent by local applications over the node network. Because each agent handles only its node's traffic, a single agent failure affects one node rather than the whole cluster. The trade-off is that every node now carries Collector resource use, and every agent needs its own configuration, upgrades and export credentials.

  • Node-level collection: Host metrics, kubelet data and container logs are naturally gathered where they are produced.
  • Small failure domain: Losing one agent drops telemetry from one node until it restarts.
  • Per-node resource cost: CPU and memory are consumed on every node, so plan for node capacity before rollout.
  • Limited cross-node view: An agent cannot make decisions that need every trace in the system, such as tail sampling.
  • Many configuration copies: Changes roll out across the whole DaemonSet, so change control matters.

Before choosing this model, confirm node counts, spare capacity and how your platform team will manage configuration across the fleet.

How the k8sattributes processor adds pod and namespace context

Telemetry without Kubernetes metadata is hard to act on. A span or metric that arrives with only an IP address or a host name tells an on-call engineer little about which workload, namespace or deployment produced it, and pods are short-lived enough that the address may already belong to another pod. The k8sattributes processor in the OpenTelemetry Collector solves this by looking up each pod in the Kubernetes API and attaching attributes such as the pod name, namespace, node and workload owner. It associates incoming data with a pod either by the source IP address seen on the connection or by resource attributes the application already sets, such as k8s.pod.name or k8s.pod.uid. Choose the association rules deliberately: IP matching works for agents running on each node, but it breaks when traffic passes through a gateway or proxy, where resource attributes are more reliable.

The processor is a client of the Kubernetes API, so it needs RBAC permission to get, list and watch pods and namespaces, and to read the owning ReplicaSets or other controllers if you want deployment names. Grant these through a ClusterRole bound to the service account the Collector runs under, and scope it to the minimum your enrichment rules require. Treat this as a security review item: the Collector can then read pod metadata across the cluster, so confirm the grant with your platform team and record it in your access review. Pod labels and annotations can be copied as attributes, but extract only the keys your dashboards and alerts use. Each distinct label value becomes a new time series in metric backends, so copying every label or an annotation such as a build ID or request identifier can multiply storage and query costs. Confirm your backend's cardinality limits before you widen extraction.

Before production use, check the stability level of every component in the pipeline. OpenTelemetry documents mixed stability levels for core Collector receivers, processors and exporters in each component's README, and a processor used in production should be at a level your team has reviewed. Pin the Collector version and the contrib distribution you deploy, and read the release notes when you upgrade, because enrichment behavior and field names can change between releases. Test the rules in a non-production cluster with a known workload, then confirm that the attributes appear on the data reaching your backend, with the expected names, before you roll the configuration out cluster-wide.

How telemetry moves from workloads to the backend

Telemetry starts in application code, either instrumented with an OpenTelemetry SDK or added by auto-instrumentation, and in the node itself where kubelet and container logs live. A node-level Collector running as a DaemonSet receives the data from pods on its node and forwards it to a gateway Collector, which runs the k8sattributes processor to attach pod, namespace and workload metadata before export. The main check is the trust boundary: the gateway is the only component that should hold credentials for the backend, and the link out of the cluster is where authentication and network policy should be verified.

Telemetry flow from pods through node and gateway Collectors to the backend, with the cluster boundary marked.

Auto-instrumentation and when to instrument by hand

The OpenTelemetry Operator can inject language instrumentation into pods without changes to application code. You create an Instrumentation resource that describes the exporter endpoint and sampling, then annotate a Deployment's pod template with the language you need, such as instrumentation.opentelemetry.io/inject-java. The Operator's webhook adds an init container and environment variables to matching pods when they start. Confirm the languages supported by the Operator version you deploy in its documentation, because support differs by runtime and changes between releases. Before enabling injection anywhere that matters, run it against a non-production namespace, check that spans arrive in your backend with the expected service names, and confirm that the injected agent does not conflict with any agent your team already loads.

Auto-instrumentation covers standard library and framework calls such as inbound HTTP requests, outbound client calls and common database drivers. It does not know your business logic. When you need spans for a payment step, a queue consumer's batch boundary or a custom attribute such as a tenant identifier, you add those with the language SDK by hand. Trace SDK maturity varies by language, so check the OpenTelemetry status page for each runtime in use before you commit to a design. Treat the stability of the traces, metrics and logs signals separately, since log SDK maturity varies more than trace support. Manual work also recurs: every new span name and attribute is code that someone must review, test and keep consistent with your naming conventions.

Most teams use both. Start with auto-instrumentation for broad coverage, then add manual spans only where an incident review or a service-level question shows a gap. Record which runtimes and framework versions were tested with injection, and rerun that test when you upgrade the Operator, the application framework or the language runtime. Ask your platform team to document the annotation pattern, the sampling setting and the owner of the Instrumentation resource in each namespace, so that a change to one workload does not silently alter telemetry for another.

Mapping Kubernetes metadata and signals to OpenTelemetry attributes

This table lists the Kubernetes identifiers that OpenTelemetry usually records as resource attributes, the signal types each source produces, and the mappings to confirm against your Collector version. Use it to decide which fields your Collector must enrich and which dashboards and queries depend on them. The main takeaway is that attribute names are the contract your queries rely on, so fix them before instrumenting teams start.

SourceTypical resource attributesSignals producedConfirm before relying on it
Pod identityk8s.pod.name, k8s.pod.uid, k8s.pod.ipTraces and logs from workloads, pod-level metricsWhether your Kubernetes attributes processor populates them for your pipeline and receiver
Namespacek8s.namespace.nameTraces, metrics and logsThat the attribute is present on every signal path, including logs read from node files
Nodek8s.node.name, host.nameNode and kubelet metrics, logs from node agentsWhether host.name and k8s.node.name carry the same value in your environment
Deployment and workloadk8s.deployment.name, k8s.replicaset.name, k8s.statefulset.nameMetrics from the cluster receiver, enriched tracesWhether owner references are resolved for your workload types and the Collector version in use
Containerk8s.container.name, container.id, container.image.nameLogs and container metricsNaming of container.image attributes, which has changed across releases
Application identityservice.name, service.namespace, service.versionTraces, metrics and logs from SDKs or auto-instrumentationThat service.name is set by the workload or derived from pod labels by your mapping rules

Securing the telemetry path end to end

Telemetry pipelines carry service names, request paths, user identifiers and sometimes payload fragments, so they need the same access controls as the systems they observe. The cards below cover authentication, transport, cluster permissions, network exposure, credential storage and redaction, in the order a reviewer usually checks them.

Authenticate incoming receiver connections

Authenticator extensions can check the identity of clients sending data to a Collector receiver, for example by validating OIDC tokens. Decide which workloads, agents and gateways may send telemetry, and which identity provider issues their tokens. Test a rejected request as well as an accepted one, so you know the receiver does not fall back to open access.

Collector configuration docs

Add credentials to exporter requests

The oauth2client extension can attach credentials to requests the Collector sends to a backend, so the backend can authorize each sender. Confirm which backend accepts this method and how tokens are refreshed. Keep the client secret in a managed secret store, not in the exporter block of a plain file.

Enable TLS on OTLP endpoints

OTLP receivers and exporters should use TLS for traffic that crosses a node, namespace or network boundary, and certificates should come from the same internal PKI your team uses for other services. Record who renews certificates and what happens when one expires. Check that plaintext ports are not exposed on the Service objects created for the Collector.

Scope RBAC for the k8sattributes processor

The k8sattributes processor reads Pod, Namespace and related metadata from the Kubernetes API to enrich telemetry. Bind it to a ServiceAccount with only the get, list and watch verbs on the resources it needs, and avoid cluster-wide write permissions. Review the ClusterRole in each environment, because a broad grant here can expose workload metadata to anyone who compromises the Collector.

Limit Collector ingress with network policy

Network policies should allow telemetry to reach the gateway only from the namespaces and workloads that send it, and allow egress only to the chosen backend. Without this, any pod in the cluster can push data into the pipeline or reach a Collector admin endpoint. Confirm that your CNI enforces NetworkPolicy before relying on it.

Keep credentials out of ConfigMaps

Collector configuration often lives in a ConfigMap that many people can read, so tokens, passwords and client secrets should not appear there in plain text. Reference them from Kubernetes Secrets or an external store, and restrict read access to those Secrets with least-privilege RBAC. Check that Helm values and GitOps repositories do not contain the same credentials.

Redact sensitive telemetry before export

Telemetry can contain personal data, tokens in URLs, SQL text and sensitive headers. Choose where redaction happens, such as attribute filtering, the redaction processor or source-side changes in the application, and document which fields are dropped or masked. Test with real sample traffic from a non-production namespace, because the default pipeline rarely catches everything.

Collector best practices

Review the configuration against best practices

The OpenTelemetry project publishes Collector configuration best practices covering security, and reviewing your configuration against them before go-live gives reviewers a shared baseline. Treat the review as a repeatable step in each change, and recheck component stability levels in each component README before using components in production.

Configuration best practices

Common failures in Kubernetes OpenTelemetry pipelines

This table lists the failures teams most often hit when running OpenTelemetry Collectors and the Operator on Kubernetes, with the likely cause and fix for each. Read it as a triage guide: find the symptom, check the cause, then confirm the fix against the component README and the Collector logs before changing production pipelines.

FailureLikely causeFix and where to look
Spans and metrics lack pod, namespace or workload labelsThe k8sattributes processor is missing, placed after the exporter, or lacks RBAC to read pods and namespacesPlace k8sattributes early in the processor chain, grant read access to pods and namespaces, and check the component README for the metadata it extracts. Confirm with Collector logs for permission errors.
Gateway Collector restarts with out-of-memory errorsTraffic from many agents exceeds memory limits, or the memory_limiter processor is absent or set too highAdd memory_limiter ahead of other processors, set container memory limits above its threshold, and scale replicas horizontally. Review restart reasons in pod events and the Collector's own telemetry.
Data disappears under load without an obvious errorThe exporter sending queue fills and drops batches, or the retry window expires before the backend recoversReview the exporter's sending queue and retry settings, size the queue for expected bursts, and alert on dropped or refused items. Check the exporter README and Collector logs for queue-full messages.
Operator fails to create or update Collector resourcesThe admission webhook certificate is missing, expired or not trusted by the API server, often after a cert-manager or Helm changeConfirm the webhook certificate chain and its CA bundle, then redeploy the Operator. Check Operator logs and the API server events for webhook call failures.
Exporter returns 401 or 403 errorsCredentials expired or are wrong, or the oauth2client or other authenticator extension is not attached to the exporterVerify the secret mounted into the Collector, attach the authenticator extension to the exporter, and confirm the token audience. Check Collector logs for authentication messages and the extension README.
Auto-instrumented services emit no spansThe instrumentation resource was not applied to the workload, the annotation is on the wrong object, or the language runtime is unsupported by the injected agentConfirm the Instrumentation resource exists in the same namespace, check the pod annotation and restart the workload, and verify the runtime is supported. Check the Operator logs and the pod's init container status.
Collector configuration rejected at startupComponent names or fields differ between Collector versions, or a component is not in the distribution in useValidate the configuration against the release in use, confirm the component is in the chosen distribution, and read the stability notes in the component README before enabling it.

Questions teams ask before running OpenTelemetry on Kubernetes

How much does it cost to run OpenTelemetry on Kubernetes?

The cost depends on the written scope, so there is no standard figure to quote here. Software is free to use under open-source licenses, and the Collector repository is licensed under Apache-2.0. The paid components are the people who design and build the pipelines, the telemetry backend that stores and queries data, and the compute and storage that run both. Ask any provider to split a quote into one-time work (design, instrumentation, dashboards, handover) and recurring work (upgrades, tuning, on-call support). DeployOpen does not publish a price list; quotes follow from a written scope.

What drives the cost and effort up or down?

Four factors move the effort most:

  • The number of clusters and namespaces that send telemetry
  • The number of application languages that need auto-instrumentation or manual instrumentation
  • The backend and how many signals (traces, metrics, logs) it must receive
  • Sizing and retention, including how much data the Collectors must process and how long it is kept

A single cluster with one language and an existing backend is a much smaller job than several clusters with mixed runtimes and new storage.

How long does an OpenTelemetry rollout take?

Duration depends on the scope and on how quickly your teams can make application changes, so no fixed timeline applies. Plan for separate phases: a design and sizing phase, a Collector and Operator deployment phase in a pilot cluster, instrumentation of the first services, then rollout to the remaining clusters. Ask for the timeline as a written milestone plan tied to the deliverables, not as a single number.

What does our team need to provide for the work?

Expect to provide cluster access with the rights to install the OpenTelemetry Operator and Collectors, a list of services and languages in scope, a chosen backend or a decision on one, and named owners who can approve changes to application deployments. Application teams must also accept that instrumentation changes their workloads. Security review of the Collector configuration and network paths to the backend should be planned from the start.

Can our own team run OpenTelemetry without an outside partner?

Yes, a capable platform team can deploy the Operator and Collectors using the public documentation. The harder work is the ongoing part: choosing between daemonset and gateway Collectors, enriching data with Kubernetes attributes, keeping auto-instrumentation consistent across languages and handling Collector upgrades. Decide which parts your team will own on day two before starting. If you want a partner, ask for the scope in writing and confirm who owns the configuration after handover.

Which observability backend should we choose?

OpenTelemetry is not a backend; it generates, exports and collects telemetry, and storage and visualization are left to separate tools. The choice should follow your existing tooling, data residency rules, retention needs and the query skills of your teams. Confirm that the backend accepts the OTLP protocol and the signals you need. Test the backend with realistic volume before committing, because storage cost and query speed often decide the design.

How do we handle Collector version upgrades?

Treat the Collector like any other production component: pin the version, test the configuration in a non-production cluster and roll out changes in stages. The OpenTelemetry Collector releases ship the contrib distribution with signed artifacts, SHA256 checksums and SBOM files, which help with verification and inventory. Check release notes before each upgrade, because component stability levels can change. Include the Operator and any custom builds in the same upgrade plan.

How do component stability levels affect production use?

Stability is set per component and per signal, so a stable trace path can sit beside an experimental log component in the same pipeline. Trace APIs and SDKs are stable in most languages, while log SDK maturity varies and several languages are still in development. Core Collector components also have mixed stability levels, documented in each component's README. Before going live, list every receiver, processor and exporter in your pipeline, record its stability level and decide which ones you accept for production.

How DeployOpen scopes and delivers this integration

DeployOpen starts with a written scope before any Collector or Operator configuration is changed. For this integration, that scope names the clusters in play, the telemetry types to collect (traces, metrics, logs or a subset), the applications to auto-instrument, the Collector topology (daemonset agents, a gateway tier or both), the backend that receives the data, and the authentication method for each exporter. Deliverables follow from that list: Helm values or OpenTelemetry Operator manifests, OpenTelemetryCollector and Instrumentation resources, Kubernetes attribute enrichment rules, a runbook and the verification evidence described below. Ask for the scope document to state which components are excluded, because backend storage, dashboards and application code changes are often assumed to be included when they are not. DeployOpen does not publish prices, and a quote follows from the written scope. The quote's main cost drivers are the number of clusters, the number of languages and services needing instrumentation, and how many pipelines need custom processing.

Delivery happens in your own clusters, using your registry, your GitOps repository and your identity provider where the Collector authenticator extensions are used. Verification checks that spans, metrics and logs arrive at the backend with the expected k8s.* resource attributes, that the gateway tier handles the configured load, that the Collector's own health and error metrics are visible, and that a failed backend is handled by the agreed retry and queue settings. Handover covers the configuration repository, the upgrade procedure for the Operator and Collector images (checked against the release notes of each Collector version you adopt), and the named owners for each pipeline. Confirm with your team whether the Collector distribution must come from an internal mirror, since that affects image pulls and SBOM review.

Two optional retainers extend the work after handover. An upgrade retainer covers Collector and Operator version moves, configuration changes for deprecated or unstable components, and regression checks on pipelines. A continuous testing retainer covers periodic review of exposed Collector receivers, authentication settings and telemetry that may carry sensitive data into traces or logs. Decide before the project starts whether you need either retainer, because the scope should record who owns each recurring task after go-live. Ask any partner, DeployOpen included, to name the Collector version and component stability levels it plans to use, and to show how each pipeline will be tested before cutover.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.