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.
Enrichment is specific to non-container OneAgent environments. Configuring a containerized Collector enrichment setup may lead to incorrect host and topology associations.
receivers:otlp:protocols:grpc:endpoint: 0.0.0.0:4317http:endpoint: 0.0.0.0:4318processors:resourcedetection/dynatrace:detectors: [dynatrace]override: falseexporters: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]
Validate your settings to avoid any configuration issues.
For our configuration, we configure the following components.
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
).
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.
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
.
DT_ENDPOINT
contains the base URL of the Dynatrace API endpoint (for example, https://{your-environment-id}.live.dynatrace.com/api/v2/otlp
)DT_API_TOKEN
contains the API tokenUnder service
, we assemble our receiver, processor, and exporter objects into service pipelines, which will perform these steps: