Ingest data from StatsD
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.
Prerequisites
- An application generating StatsD messages
- One of the following Collector distributions with the StatsD receiver, transform processor, and filter processor.
- The Dynatrace Collector
- OpenTelemetry Contrib
- A custom Builder version
- The API URL of your Dynatrace environment
- An API token with the relevant access scope
Demo configuration
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: 100# Processors for histogram observers# See histogram summaries documentation linked below for detailsprocessors:transform:metric_statements:- context: metricstatements:- extract_count_metric(true) where type == METRIC_DATA_TYPE_HISTOGRAM- extract_sum_metric(true) where type == METRIC_DATA_TYPE_HISTOGRAM- convert_sum_to_gauge() where IsMatch(name, ".*_sum")filter:metrics:metric:- type == METRIC_DATA_TYPE_HISTOGRAMexporters:otlphttp:endpoint: ${env:DT_ENDPOINT}headers:Authorization: "Api-Token ${env:DT_API_TOKEN}"service:pipelines:traces: nullmetrics:receivers: [statsd]processors: [transform,filter]exporters: [otlphttp]logs: null
Validate your settings to avoid any configuration issues.
Components
For our configuration, we configure the following components.
Receiver
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 Dyntrace 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.
Processors
Under processors
, we configure the transform
and filter
processors to prepare the histogram OTLP metrics for Dynatrace. For details, see the histogram summaries documentation.
Exporter
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 your ActiveGate (for example,https://{your-environment-id}.live.dynatrace.com/api/v2/otlp
)DT_API_TOKEN
contains the API token
Service pipeline
Under service
, we assemble our receiver, processors, and exporter objects into a metrics pipeline, which accepts StatsD data and ingests it into Dynatrace.
Limits and limitations
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: