This simple example demonstrates monitoring statsd sources with the OpenTelemetry collector, using the statsd receiver and sending the data to New Relic via OTLP. A simple load statsd load generator is configured to send dummy data to the statsd receiver.
- You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. Docker desktop includes a standalone Kubernetes server and client which is useful for local testing.
- A New Relic account
- A New Relic license key
-
Update the
NEW_RELIC_API_KEY
value in secrets.yaml to your New Relic license key.# ...omitted for brevity stringData: # New Relic API key to authenticate the export requests. # docs: https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#license-key NEW_RELIC_API_KEY: <INSERT_API_KEY>
-
Note, be careful to avoid inadvertent secret sharing when modifying
secrets.yaml
. To ignore changes to this file from git, rungit update-index --skip-worktree k8s/secrets.yaml
. -
If your account is based in the EU, update the
NEW_RELIC_OTLP_ENDPOINT
value in collector.yaml the endpoint to: https://otlp.eu01.nr-data.net
# ...omitted for brevity env: # The default US endpoint is set here. You can change the endpoint and port based on your requirements if needed. # docs: https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/best-practices/opentelemetry-otlp/#configure-endpoint-port-protocol - name: NEW_RELIC_OTLP_ENDPOINT value: https://otlp.eu01.nr-data.net
-
-
Run the application with the following command.
kubectl apply -f k8s/
- When finished, cleanup resources with the following command. This is also useful to reset if modifying configuration.
kubectl delete -f k8s/
To review your statsd data in New Relic, navigate to "New Relic -> Query Your Data". To list the metrics reported, query for:
FROM Metric SELECT uniques(metricName) WHERE otel.library.name = 'otelcol/statsdreceiver' LIMIT MAX
See get started with querying for additional details on querying data in New Relic.
A simple load statsd load generator is configured to send dummy data to the statsd receiver, specified in gen-statsd.yaml. To use in production, you'll need to configure your statsd data sources to point to the collector's statsd receiver endpoint. In this example, the collector's statsd receiver is listing for UDP on 0.0.0.0:8125
, which is exposed in a service. The load generator is configured point to this using service env vars set by kubernetes.