Skip to content

Add APM ↔ Elasticsearch distributed tracing correlation docs - #25706

Draft
vagrawal-newrelic wants to merge 3 commits into
newrelic:developfrom
vagrawal-newrelic:docs-es-otel-apm-dt-correlation
Draft

vagrawal-newrelic wants to merge 3 commits into
newrelic:developfrom
vagrawal-newrelic:docs-es-otel-apm-dt-correlation

Conversation

@vagrawal-newrelic

Copy link
Copy Markdown
Contributor

Summary

Documents how to correlate APM applications with Elasticsearch clusters using distributed tracing (pure OpenTelemetry), a more seamless alternative to hardcoding es.cluster.name into each application's metrics.

Elasticsearch 9.4+ emits its own OTLP spans, joins the application's trace via the W3C traceparent header, and stamps es.cluster.name on each span — so New Relic builds the service → cluster relationship automatically, with no per-application configuration.

Changes by page

  • elasticsearch-otel-integration-install.mdx (on-host) & elasticsearch-otel-integration-k8-install.mdx (Kubernetes): replaced the metrics-only correlation callout with a full "Correlate APM with Elasticsearch" section — an approach-comparison table (distributed tracing vs. metrics-only) plus step-by-step tracing setup.
  • elasticsearch-otel-integration-overview.mdx: added an APM-correlation bullet to "What you'll get".
  • find-and-query-data.mdx: added Span NRQL queries and service-map correlation notes.
  • troubleshooting.mdx: added an "APM correlation and distributed tracing" troubleshooting section.

Notable detail: the collector transform

The tracing setup includes a collector transform/strip_es_host processor that drops http.request.headers.host and server.address from Elasticsearch's own spans. Without it, New Relic resolves the node's own address back to the cluster and draws a self-referential (cluster CALLS cluster) relationship. This was validated against a live cluster.

Validation status

The on-host path was validated end-to-end against a live Elasticsearch cluster + OTel collector → New Relic. The Elasticsearch tracing settings are identical for Kubernetes, but the K8s pod injection mechanics were not tested in a cluster — reviewers should sanity-check the ECK/Helm injection details on that page.

Document the distributed-tracing approach to correlating APM applications
with Elasticsearch clusters (OpenTelemetry integration). Elasticsearch 9.4+
emits its own OTLP spans, joins the app's trace via the traceparent header,
and stamps es.cluster.name — so New Relic wires up the service → cluster
relationship automatically, without per-app changes.

- install (on-host) & k8-install: replace the metrics-only correlation
  callout with a "Correlate APM with Elasticsearch" section (approach
  comparison + step-by-step tracing setup, including the collector
  transform that strips ES's own host address to prevent the cluster
  self-loop)
- overview: add APM-correlation bullet to "What you'll get"
- find-and-query-data: add span queries + service-map correlation notes
- troubleshooting: add APM correlation / distributed tracing section
@vagrawal-newrelic
vagrawal-newrelic requested a review from a team as a code owner September 15, 2026 07:27
@github-actions

Copy link
Copy Markdown
Contributor

Hi @vagrawal-newrelic 👋

Thanks for your pull request! Your PR is in a queue, and a writer will take a look soon. We generally publish small edits within one business day, and larger edits within three days.

Please ensure the propsed changes look good by building it first in your local environment. Refer to this contribution guide to get the site up and running in your local.

If you really require a preview url, reach out to one of the writers and they will generate one for you.

@PallaviWrite
PallaviWrite marked this pull request as draft September 15, 2026 09:38
Validated the distributed-tracing correlation end-to-end on a Kubernetes
(ECK) cluster with apps in 5 languages, which surfaced a few refinements:

- Self-loop fix: add a filter/drop_rootless_es (IsRootSpan) processor to
  the traces pipeline on both install pages. On K8s the strip_es_host
  transform alone isn't enough — parentless Elasticsearch spans (health
  probes and the metrics receiver's own scrape calls) also make the
  cluster "call itself". Reworded the explanation to cover both causes.
- Cluster-name matching: the metrics elasticsearch.cluster.name must match
  the cluster.name Elasticsearch stamps on its spans (es.cluster.name),
  otherwise metrics and traces resolve to separate entities and the
  correlated entity shows no metrics. Added this guidance to every metrics
  path (NRDOT, OTel Contrib, and Prometheus) on both pages, and kept the
  uniqueness note.
- Troubleshooting: expanded the self-loop entry (both causes + both
  processors) and rewrote the traces/metrics name-mismatch entry.
- K8s page: aligned the correlation section with the on-host standard
  (removed the extra verify line, em-dash → comma).
Trim the "must match" callouts/notes to a short caution to keep the
metrics cluster name the same as the Elasticsearch cluster.name, without
spelling out the consequences and examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant