The following configuration example shows how you configure a Collector instance to ingest data from an existing StatsD setup and import it as an OTLP request into Dynatrace.
receivers:statsd:endpoint: 0.0.0.0:8125timer_histogram_mapping:- statsd_type: "histogram"observer_type: "histogram"histogram:# max size for the auto-scaling exponential histogram OTLP metric# see below for detailsmax_size: 100- statsd_type: "timing"observer_type: "histogram"histogram:max_size: 100- statsd_type: "distribution"observer_type: "histogram"histogram:max_size: 100exporters:otlphttp:endpoint: ${env:DT_ENDPOINT}headers:Authorization: "Api-Token ${env:DT_API_TOKEN}"service:pipelines:metrics:receivers: [statsd]exporters: [otlphttp]
Validate your settings to avoid any configuration issues.
For our configuration, we configure the following components.
Under receivers
, we specify the statsd
receiver as active receiver component for our Collector instance. We configure the receiver to listen on all network interfaces to port 8125
, which is the port typically used for StatsD.
The receiver is configured to aggregate histogram, timer, and distribution messages into exponential histograms, which are later processed for Dynatrace ingestion. The receiver uses auto-scaling exponential histograms, and we have selected a maximum size of 100
. This means that the histogram will begin with very granular bucket boundaries and automatically re-scale itself if it receives data points that would result in more than 100
buckets.
For a full list of configuration parameters and supported StatsD metric types, see the StatsD receiver documentation.
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, processors, and exporter objects into a metrics pipeline, which accepts StatsD data and ingests it into Dynatrace.
Metrics are ingested using the OpenTelemetry protocol (OTLP) via the Dynatrace OTLP API and are subject to the API's limits and restrictions. For more information see: