The OpenTelemetry Collector provides an integration with StatsD to ingest metrics. The Collector fetches metrics from the configured path in the StatsD receiver. From there the metrics are processed and exported to Cloud Observability.
To complete the integration, you will:
StatsD emits metrics through custom StatsD format. Emitted metrics are broadcasted from StatsD using UDP on the StatsD default port
In the Collector configuration file, add StatsD as a receiver and set the following:
1 2 3 4 5 6 7 8 9 10 11 receivers: statsd: statsd/2: endpoint: "otel-collector:8125" aggregation_interval: 70s is_monotonic_counter: true timer_histogram_mapping: - statsd_type: "histogram" observer_type: "summary" - statsd_type: "timing" observer_type: "summary"
The OpenTelemetry repo provides additional details about StatsD configuration.
Once the StatsD receiver is configured, enable it by adding it to one or more pipelines as described in the Collector configuration documentation.
You can validate that metrics are reporting to Cloud Observability on the Metrics details page in Project settings.
In Cloud Observability, click Project settings > Metric details.
Search for StatsD metric names.
If needed, click on the metric to edit the description and how the units are displayed in Cloud Observability.
Use the Cloud Observability Terraform Provider to create a dashboard for the metrics.
For a more complete example that’s ready to run, see the StatsD integration in Cloud Observability OpenTelemetry Examples.
Histograms are currently unsupported in the current Open Telemetry StatsD receiver (v0.58). A future release of the StatsD receiver repository is being worked on to resolve this issue. See this merge request and open issue on the StatsD receiver’s current status.
When this issue is resolved the
observer_types in the collector configuration are subject to change to more consistent values.
Updated Dec 1, 2022