Add APM ↔ Elasticsearch distributed tracing correlation docs - #25706
Draft
vagrawal-newrelic wants to merge 3 commits into
Draft
vagrawal-newrelic wants to merge 3 commits into
vagrawal-newrelic wants to merge 3 commits into
Conversation
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
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents how to correlate APM applications with Elasticsearch clusters using distributed tracing (pure OpenTelemetry), a more seamless alternative to hardcoding
es.cluster.nameinto each application's metrics.Elasticsearch 9.4+ emits its own OTLP spans, joins the application's trace via the W3C
traceparentheader, and stampses.cluster.nameon 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_hostprocessor that dropshttp.request.headers.hostandserver.addressfrom 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.