For monitoring your Kubernetes cluster and workloads you can also use the OpenTelemetry Kubernetes Operator.
We recommend to use the Dash0 Kubernetes Operator instead, as it comes the with several additional features like configuration as code, while having fewer manual installation steps.
Use the OpenTelemetry Kubernetes operator to manage OpenTelemetry collector deployments. It is generally useful for advanced observability needs.
The OpenTelemetry Operator simplifies and automates the management of OpenTelemetry within your Kubernetes environment. It handles everything from managing collectors to enabling auto-instrumentation for your applications.
Before deploying the OpenTelemetry Operator, ensure that Cert Manager is installed. It's a required prerequisite. If it is not already running in your cluster, you can install it using Helm with the following commands:
You can now deploy the OpenTelemetry Operator. The collectorImage repository must be explicitly specified, as the default image is the OpenTelemetry Collector core distribution, which lacks the necessary components.
Additionally, it is recommended to define the namespace where the operator will be deployed and ensure it is created if it does not already exist:
If you need automatic instrumentation for Go applications, you can enable it by adding the following flag to the command above:
Note: Enabling this feature comes with security trade-offs, as it relies on eBPF, which requires elevated permissions for the sidecar container. For more details, see this deep dive.
To send data to Dash0, you need to obtain your Authorization Token and store it as a Kubernetes secret.
Run the following command to create a secret containing your Dash0 Authorization Token:
In this configuration, we will deploy two different OpenTelemetry Collectors:
otel-collector
(mode: DaemonSet)
otel-collector-central
(mode: Deployment)
Our OpenTelemetry Collectors need to interact with various Kubernetes components, such as the Kubernetes API, to collect telemetry data. To enable this, we must ensure they have the necessary permissions and access within the cluster.
Deploy the necessary ServiceAccount
's, ClusterRoleBinding
's, ClusterRole
's to the cluster:
Deploy the otel-collector
:
Deploy the otel-collector-central
:
The OpenTelemetry Collectors have now been deployed to your cluster and can be used to send data.
The following services can be addressed within your cluster now, and all sent data will be forwarded to Dash0 using the configured endpoint and Auth Token:
otel-collector.opentelemetry
is ClusterIP service. It can be addressed using OTLP gRPC (tcp/4317
) and OTLP HTTP (tcp/4318
)otel-collector-headless.opentelemetry
can be used as a headless service. It can be addressed using OTLP gRPC (tcp/4317
) and OTLP HTTP (tcp/4318
)By default, the OpenTelemetry Operator does not automatically instrument workloads. If you want your applications to be
instrumented automatically first create an Instrumentation
configuration and add it to your cluster:
Next add the following annotation to your workload's pod spec:
Refer to the official OpenTelemetry Operator troubleshooting documentation.