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.
See Collector Deployment and Collector Configuration on how to set up your Collector with the configuration below.
receivers:otlp:protocols:grpc:endpoint: 0.0.0.0:4317http:endpoint: 0.0.0.0:4318processors:resource_detection/dynatrace:detectors: [dynatrace]override: falseexporters:otlp_http:endpoint: ${env:DT_ENDPOINT}headers:Authorization: "Bearer ${env:DT_PLATFORM_TOKEN}"service:pipelines:traces:receivers: [otlp]processors: [resource_detection/dynatrace]exporters: [otlp_http]metrics:receivers: [otlp]processors: [resource_detection/dynatrace]exporters: [otlp_http]logs:receivers: [otlp]processors: [resource_detection/dynatrace]exporters: [otlp_http]
Assign the scope that matches your signal type: openpipeline:logs:ingest for logs, openpipeline:metrics:ingest for metrics, or openpipeline:traces:ingest for traces.
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 resource_detection processor and configure it with the Dynatrace-specific detector dynatrace.
With this configuration, the resource detector processor will attempt to load the following three attributes from the OneAgent enrichment file:
dt.entity.hosthost.namedt.smartscape.hostIf 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 otlp_http 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).
One token variable, depending on the token type you use:
DT_PLATFORM_TOKEN contains your platform token with the openpipeline:logs:ingest, openpipeline:metrics:ingest, and openpipeline:traces:ingest scopes.DT_API_TOKEN contains your Classic access token with the Ingest logs (logs.ingest), Ingest metrics (metrics.ingest), and Ingest OpenTelemetry traces (openTelemetryTrace.ingest) scopes.Under service, we assemble our receiver, processor, and exporter objects into service pipelines, which will perform these steps: