Enrich with OneAgent (non-containerized)

The following configuration example shows how you configure a Collector instance to enrich OpenTelemetry data with OneAgent host entities.

Enrichment is used for linking OpenTelemetry data to its OneAgent host and properly associating it within the topology model. For example, when ingesting logs from different hosts, tying the host entity to the respective log data allows you to run host-based log analytics tasks.

Container environments

Enrichment is specific to non-container OneAgent environments. Configuring a containerized Collector enrichment setup may lead to incorrect host and topology associations.

Prerequisites

Demo configuration

receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
resourcedetection/dynatrace:
detectors: [dynatrace]
override: false
exporters:
otlphttp:
endpoint: ${env:DT_ENDPOINT}
headers:
Authorization: "Api-Token ${env:DT_API_TOKEN}"
service:
pipelines:
traces:
receivers: [otlp]
processors: [resourcedetection/dynatrace]
exporters: [otlphttp]
metrics:
receivers: [otlp]
processors: [resourcedetection/dynatrace]
exporters: [otlphttp]
logs:
receivers: [otlp]
processors: [resourcedetection/dynatrace]
exporters: [otlphttp]
Configuration validation

Validate your settings to avoid any configuration issues.

Components

For our configuration, we configure the following components.

Receivers

Under receivers, we specify the standard otlp receiver as active receiver component for our Collector instance.

This is mainly for demonstration purposes. You can specify any other valid receiver here (for example, zipkin).

Processors

Under processors, we specify the resourcedetection processor and configure it with the Dynatrace-specific detector dynatrace.

With this configuration, the resource detector processor will attempt to load the following two attributes from the OneAgent enrichment file:

  • dt.entity.host
  • host.name

If the resource detector could load these values successfully, it will add them as resource attributes to the OTLP request. No additional processor configuration is necessary.

Exporters

Under exporters, we specify the default otlphttp exporter and configure it with our Dynatrace API URL and the required authentication token.

For this purpose, we set the following two environment variables and reference them in the configuration values for endpoint and headers.

Service pipeline

Under service, we assemble our receiver, processor, and exporter objects into service pipelines, which will perform these steps:

  • accept OTLP requests on the configured ports
  • enrich them with the Dynatrace-relevant host data, using the resource detector processor
  • and export the enriched data to Dynatrace