Docs

New Relic Integration

Learn how to export Observability Kit metrics and traces to New Relic over OTLP.

New Relic is an observability SaaS platform with support for metrics, traces, and logs. It accepts OpenTelemetry Protocol (OTLP) natively, so the kit’s telemetry can be sent directly to New Relic’s OTLP endpoint with no collector in between.

New Relic Account

Sign up for an account at newrelic.com/signup. You can export up to 100 GB of data per month at no charge.

You need an ingest license key. Find it in your account settings under API Keys; use a key of type INGEST - LICENSE.

Configure the Application

Add Actuator with the OTLP metrics registry, and a tracing bridge with the OTLP exporter:

Source code
pom.xml
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-otlp</artifactId>
</dependency>
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-tracing-bridge-otel</artifactId>
</dependency>
<dependency>
    <groupId>io.opentelemetry</groupId>
    <artifactId>opentelemetry-exporter-otlp</artifactId>
</dependency>

Point both pipelines at the New Relic OTLP endpoint and authenticate with the license key:

Source code
application.properties
spring.application.name=vaadin

# Metrics over OTLP to New Relic
management.otlp.metrics.export.url=https://otlp.nr-data.net/v1/metrics
management.otlp.metrics.export.headers.api-key=LICENSE_KEY

# Traces over OTLP to New Relic
management.otlp.tracing.endpoint=https://otlp.nr-data.net/v1/traces
management.otlp.tracing.headers.api-key=LICENSE_KEY
management.tracing.sampling.probability=1.0

Replace LICENSE_KEY with your ingest license key. Use the EU endpoint (https://otlp.eu01.nr-data.net) instead if your account is in the EU region. Setting spring.application.name determines the service name your data appears under in New Relic.

Viewing Data

After exercising the application for a while — traces show up with a short delay — log in to New Relic. From the All entities view, select your service name under Services - OpenTelemetry.

Viewing Traces

Open the Monitor - Distributed tracing view, which shows application traces with their count, duration, and errors.

See the New Relic Distributed tracing documentation for more.

Viewing Metrics

Open the Data - Metrics explorer view, where you can explore all reported metrics.

See the New Relic Metrics explorer documentation for more.

Viewing Logs

Open the Monitor - Logs view, which shows application logs linked to traces through trace.id.

See the New Relic Logs documentation for more.

Updated