OpenTelemetry Collector Kubernetes setup for Dynatrace: Helm, Operator and k8sattributes
Your pods send OpenTelemetry traces, but in Dynatrace they arrive with no pod name, no namespace and no node. You cannot tie a latency spike to a specific deployment, and MTTR grows. Deploying an OpenTelemetry Collector Kubernetes DaemonSet, enriched by the k8sattributes processor, fixes this at the source. Goal of this tutorial: install a Collector in the cluster with Helm (or with the…
Dynatrace users often face the challenge of OpenTelemetry traces arriving without pod names, namespaces, and nodes. This makes it difficult to correlate latency spikes to specific deployments, resulting in longer Mean Time To Resolution (MTTR). To resolve this, deploying an OpenTelemetry Collector DaemonSet enriched with the k8sattributes processor can be beneficial.
The goal of this tutorial is to install the Collector in the Kubernetes cluster using either Helm or the OpenTelemetry Operator, add Kubernetes metadata to each span, metric, and log, and then export everything over OTLP to Dynatrace. The steps apply to both Dynatrace SaaS and Managed, with only the ingest URL differing.
Prerequisites for this setup include a Kubernetes cluster version 1.26 or later, kubectl, Helm 3, a Dynatrace API token with openTelemetryTrace.ingest, metrics.ingest, and logs.ingest scopes, and an OTLP URL. The OTLP URL for SaaS is https:// env-id .live.dynatrace.com/api/v2/otlp, while for Managed it is https:// your-domain /e/ env-id /api/v2/otlp.
The tutorial recommends using a DaemonSet deployment mode, as each Collector only watches the pods on its own node. This approach is the recommended method for the k8sattributes processor. The tutorial does not use the Dynatrace Operator, as it manages OneAgent and ActiveGate and should not be confused with the OpenTelemetry Operator, which manages Collectors and auto-instrumentation.
To install the Collector using Helm, first create a namespace and a secret containing the Dynatrace token. Then, write a values.yaml file specifying the DaemonSet mode, the image (otel/opentelemetry-collector-contrib), and the required configurations, such as the k8sattributes processor, memory limiter, and exporters to Dynatrace.
Finally, install the chart using the helm upgrade command with the specified values.yaml file. Once installed, point your applications to the node's Collector by setting the NODE_IP and OTEL_EXPORTER_OTLP_ENDPOINT environment variables in each application pod.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to