Skip to main content
All recipes

New Relic

CodeOTLP

Send request metrics to New Relic using your OpenTelemetry provider and the SDK’s beforeSend hook.

Point the OTel exporter at New Relic

Set these in the environment where your OpenTelemetry metrics provider runs. This is the US endpoint; use the New Relic endpoint for your region. Keep the license key in server-side secrets.

Bash
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.nr-data.net
export OTEL_EXPORTER_OTLP_HEADERS="api-key=$NEW_RELIC_LICENSE_KEY"

Use the OpenTelemetry mirror pattern

Use the beforeSend example from the OpenTelemetry recipe, then configure your OTLP exporter to send those measurements to New Relic.

Continue your setup

Check runtime availability and credentials before deploying an integration.