• /
  • EnglishEspañolFrançais日本語한국어Português
  • ログイン今すぐ開始

NGINX distributed tracing with OpenTelemetry

|View as Markdown (English)

NGINX 1.25.3 and later includes the ngx_otel_module, a native OpenTelemetry module that adds distributed tracing support directly in the web server.

When you combine ngx_otel_module with instrumented applications, New Relic connects the traces end-to-end and creates service relationships between your services and the NGINX entity. These relationships appear in service maps, giving you visibility into how traffic flows through your web server or reverse proxy.

How it works

In a typical setup, traffic flows like this:

Instrumented app (client) → NGINX (with ngx_otel_module) → Instrumented app (backend)
  1. The client application sends a request with a W3C traceparent header.
  2. NGINX's ngx_otel_module extracts the trace context, creates a span for the request, and injects updated trace context into the request proxied to the upstream backend.
  3. The backend application receives the request with the propagated trace context and continues the trace.
  4. All spans (from the client, NGINX, and the backend) are exported to an OpenTelemetry Collector, which enriches the NGINX spans with the NGINX identity and forwards them to New Relic.

New Relic uses these connected spans to create CALLS relationships:

  • Client service CALLS NGINX entity
  • NGINX entity CALLS Backend service

Because the collector stamps the same nginx.deployment.name and nginx.server.endpoint identity that the NGINX metrics use, the NGINX spans resolve to the same NGINXSERVER entity as your NGINX metrics. These relationships are visible in service maps and the maps experience.

Compatibility

ngx_otel_module 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, Go)
  • New Relic APM agents (Go, Java, .NET, Node.js, Python, Ruby, PHP) with distributed tracing enabled

You can mix instrumentation approaches. For example, an OTel SDK client can call through NGINX to a New Relic APM agent backend, and the relationship chain appears correctly in New Relic.

Before you begin

Ensure you have:

ヒント

This guide sets up both metrics collection and distributed tracing in a single OTel Collector. For metrics-only configuration or Kubernetes deployment, see Monitor self-hosted NGINX and Monitor NGINX on Kubernetes.

Set up distributed tracing

ヒント

The traces pipeline below is the same standard setup you would use for any service participating in distributed tracing. It's not a manual relationship configuration. Once tracing is active, New Relic automatically detects the connected spans and creates service relationships.

Troubleshooting

Next steps

Copyright © 2026 New Relic株式会社。

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