For Kubernetes, the Dynatrace Collector can be deployed in the following ways:
OpenTelemetry Kubernetes Operator
Helm
Raw manifest
Dynatrace access details
Before you deploy the Collector, you need to set up the necessary Kubernetes secrets for the Dynatrace access details.
Use kubectl to create Kuberenetes secrets for the Dynatrace export details. Replace the placeholders (indicated by curly brackets) with the actual values for the export URL and the API token.
The following sample configurations apply a resource limit of 512 megabytes. You may need to adjust this under resources.limits.memory for your particular use case.
Prerequisites
If you haven't installed OpenTelemetry Operator yet, first make sure cert-manager is installed. Afterwards, you can deploy Operator with the following kubectl command:
After the installation, deploy the Dynatrace Collector either as a gateway or an agent, with one of the following configuration samples. Save it as crd-dynatrace-collector.yaml and deploy it with kubectl apply.
The Helm charts below use alternateConfig to provide the Collector configuration. With this entry, the default Helm chart configuration, as well as a possibly present config object, will be ignored.
Deploy as a gateway (Deployment)
Save the following YAML configuration under values-deployment.yaml
-containerPort:8888# Default endpoint for querying metrics of prometheus exporter.
volumeMounts:
-name: dynatrace-otel-collector-config
mountPath: /conf
volumes:
-configMap:
name: dynatrace-otel-collector-config
items:
-key: otel-collector-config
path: otel-collector-config.yaml
name: dynatrace-otel-collector-config
Service account
In Kubernetes, it is common to enrich OpenTelemetry signals using the Kubernetes Attributes processor. This requires a Kubernetes service account, which is automatically configured when using Operator or Helm.
For raw manifests, this needs to be configured manually by adding a spec.serviceAccountName: collector entry to the deployment manifest.
Docker
Run the following command to download the image of the Dynatrace Collector:
Next, run the Collector image with the following command:
docker run -v $(pwd)/otel-collector-config.yaml:/etc/otelcol/otel-collector-config.yaml ghcr.io/dynatrace/dynatrace-otel-collector/dynatrace-otel-collector:latest --config=/etc/otelcol/otel-collector-config.yaml
The -v parameter maps the local configuration file to the given container path, which is subsequently passed to the --config parameter.
Make sure to map all required network ports with the -p parameter. For example, if you accept OTLP gRPC requests on the default port, you need to specify port 4317. For OTLP over HTTP specify port 4318.
Docker Compose
Use the following configuration in your Compose file to deploy and run the Collector image:
Dynatrace also provides DEB and RPM installer packages for Linux systems on x86-64 and ARM64 architectures.
Required init system
The installer packages require Systemd to be the active init system.
To deploy the Collector using an installer package, download the latest version for your operating system from GitHub, and install it using root privileges and the following commands.
Replace the following two placeholders in the commands with their actual content:
<VERSION> with the version tag of the download
<ARCH> with the system architecture tag (that is, x86_64 or arm64) of the download
When first starting the service, it may fail to start if there is no configuration file in place yet. By default, the Collector attempts to find the file at /etc/dynatrace-otel-collector/config.yaml.
Custom configuration location
If you wish to use a different path, you can override the default path with the --config parameter as part of the OTELCOL_OPTIONS variable in the Systemd environment file at /etc/dynatrace-otel-collector/dynatrace-otel-collector.conf:
Subsequent package updates will replace this file, so be sure to back up and restore its content during an update of the Collector package. Alternatively, you can override the configuration with the systemctl edit command.
To see all available configuration options, run the Collector binary with the --help parameter.
After changing the configuration, make sure to restart the service using the following command and root privileges:
systemctl restart dynatrace-otel-collector
Service status
To view the current status of the Collector service, run the following command with root privileges:
systemctl status dynatrace-otel-collector
To check the output of the Collector service, run the following command with root privileges:
journalctl -u dynatrace-otel-collector
Container image registries
Container images for the Dynatrace distribution of the OpenTelemetry Collector are available in
The Collector can be deployed as a standalone agent, a gateway, or a sidecar.
As an agent, the Collector is deployed either with the application or (recommended) on the same host as the application. This Collector can receive telemetry data and enhance it with, for example, tags or infrastructure information.
As a gateway, one or more Collector instances can be deployed as standalone services. This Collector can be deployed additionally, for example, per cluster, region, or data center. A load balancer can help scale the independently operating Collector instances.
In Kubernetes clusters, you can use a variant of the agent mode and deploy the Collector as a sidecar to your application pods.
You need to use the OpenTelemetry operator for this deployment option. Be aware that using the Collector as a sidecar might increase resource consumption.
It's also possible to combine these deployment modes and chain Collector instances. Consider this if you are deploying the Collector in large environments.