• /
  • EnglishEspañolFrançais日本語한국어Português
  • 로그인지금 시작하기

Correlate APM with Elasticsearch using distributed tracing

|View as Markdown (English)

By default, New Relic monitors your APM application and your Elasticsearch cluster as two separate, unconnected items: Nothing shows you that the app actually calls that cluster.

This page closes that gap using Elasticsearch's native OpenTelemetry distributed tracing. Elasticsearch exports its own trace spans through the same OpenTelemetry collector (NRDOT or OTel Collector Contrib) you already use for metrics, with no per-application changes. The result: a slow transaction leads you straight to the cluster that served it.

Under the hood, your application and Elasticsearch each contribute their part of the same request to a single, shared trace. New Relic recognizes that both sides belong together and builds the service-to-cluster relationship for you automatically.

팁

Distributed tracing is one of two ways to correlate APM with Elasticsearch. It gives you full request-level detail, but the extra trace data adds to your ingest volume. If you only need the cluster to show up as a related entity, you can tag your APM application's telemetry with your cluster's name instead — this works on any Elasticsearch version, but skips the end-to-end trace detail.

Compatible instrumentation

This correlation works with any application that supports W3C Trace Context propagation, including:

  • OpenTelemetry SDK instrumented applications (any language)
  • OpenTelemetry auto-instrumentation (Java, .NET, Python, Node.js)
  • New Relic APM agents (Go, Java, .NET, Node.js, Python, Ruby, PHP) with distributed tracing enabled

You can mix instrumentation approaches. For example, a Java service using a New Relic APM agent and a Python service using the OpenTelemetry SDK can both call the same Elasticsearch cluster, and each appears correctly linked to it in New Relic.

You need

Before you begin, make sure you have:

  • A valid New Relic license key
  • Elasticsearch 9.4 or later, since native OTLP trace export requires this version
  • An OpenTelemetry collector (OTel Collector Contrib or NRDOT) already running and reachable from your Elasticsearch nodes. If you haven't installed one yet, follow the self-hosted installation or Kubernetes installation.
  • Instrumented applications sending requests to Elasticsearch, using any of the compatible instrumentation approaches listed above, with distributed tracing enabled
  • Network access from the collector to New Relic's OTLP endpoint

Configure distributed tracing

Configuration has two parts: turn on tracing in Elasticsearch, and add a traces pipeline to your collector.

Once you turn on tracing, Elasticsearch emits its own OpenTelemetry spans, joins your application's trace through the traceparent header, and stamps es.cluster.name on each one. New Relic uses that shared trace to wire up the relationship automatically.

Expand the section that matches your deployment.

View your traces

Once spans are flowing, you can query them and inspect the correlated service map. See View distributed traces and APM correlation for query examples and where to find the service map in New Relic.

Troubleshooting

If you don't see spans, if the cluster shows a relationship to itself, or if applications aren't linking to the cluster, see the APM correlation and distributed tracing section of the troubleshooting guide.

Copyright © 2026 New Relic Inc.

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