• Log inStart now

Collector with New Relic (basic setup)

Instead of sending telemetry from your apps directly to New Relic, you can first send it to an OpenTelemetry collector. You can use the collector to process your telemetry data, and then export it to New Relic (or any other back-end). To learn about what kinds of processing you can do in the collector, see our introduction.

The Docker example below is meant to serve as starting point from which you can extend, customize, and validate configurations before using them in production.

The collector setup is part of the larger process of setting up OpenTelemetry with New Relic. Before following the collector steps below, make sure you've completed the preceding setup steps. If you've completed the previous steps, use the following example to get started with the collector. Keep in mind that this illustrates the minimal configurations to push any telemetry source to New Relic. You should adapt it based on your observability requirements:

  1. Save the following as otel-config.yaml:

    receivers:
    otlp:
    protocols:
    grpc:
    http:
    processors:
    batch:
    exporters:
    otlp:
    endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT}
    headers:
    api-key: ${NEW_RELIC_LICENSE_KEY}
    service:
    pipelines:
    traces:
    receivers: [otlp]
    processors: [batch]
    exporters: [otlp]
    metrics:
    receivers: [otlp]
    processors: [batch]
    exporters: [otlp]
    logs:
    receivers: [otlp]
    processors: [batch]
    exporters: [otlp]
  2. Run the OpenTelemetry collector after you make the following changes:

    • Replace OTLP_ENDPOINT_HERE with the appropriate endpoint.
    • Replace YOUR_KEY_HERE with your account's license key.
    export OTEL_EXPORTER_OTLP_ENDPOINT=OTLP_ENDPOINT_HERE
    export NEW_RELIC_LICENSE_KEY=YOUR_KEY_HERE
    docker run --rm \
    -e OTEL_EXPORTER_OTLP_ENDPOINT \
    -e NEW_RELIC_LICENSE_KEY \
    -p 4317:4317 \
    -v "${PWD}/otel-config.yaml":/otel-config.yaml \
    --name otelcol \
    otel/opentelemetry-collector \
    --config otel-config.yaml
  3. If you are completing the installation steps, return to Step 5. View your data in the New Relic UI.

Copyright © 2022 New Relic Inc.

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