• EnglishEspañol日本語한국어Português
  • Log inStart now

Collector for StatsD metrics

You can collect StatsD metrics with the OpenTelemetry collector. The collector is a component of OpenTelemetry that collects, processes, and exports telemetry data to New Relic (or any observability backend).

Complete the steps below to collect StatsD metrics:

Step 1: Sign up for your free account if you haven't already

Step 2: Prerequisites

The collector will use the StatsD receiver component. It requires permission to listen on the configured endpoint (localhost:8125 by default).

Step 3: Install OpenTelemetry collector

Download and install the OpenTelemetry collector following the OpenTelemetry docs.

You will need to install OpenTelemetry Collector Contrib Distro or other distribution including, at least, these components:

Step 4: Configure OpenTelemetry collector

Update or create a new file called config.yaml from the example below.

Replace the NEW_RELIC_LICENSE_KEY in the file with your own values. For more info, see the New Relic License key.

receivers:
statsd:
is_monotonic_counter: true
exporters:
otlphttp:
endpoint: https://otlp.nr-data.net
headers:
api-key: NEW_RELIC_LICENSE_KEY
service:
telemetry:
logs:
pipelines:
metrics:
receivers: [statsd]
exporters: [otlphttp]

For further configuration options, please review:

Step 4: Run the collector

Run the OpenTelemetry collector (the way to run it may vary depending on the chosen installation method). Example:

/usr/bin/otelcol-contrib --config ./config.yaml

Step 5: Find and use your data

Explore and query your data

The collector will report the metrics ingested using StatsD messages, please review:

You can list the metrics being reported by the statsd receiver:

FROM Metric SELECT uniques(metricName) WHERE otel.library.name = 'otelcol/statsdreceiver' LIMIT MAX

Troubleshooting

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.