# Stop Guessing: Trace Every LLM Request With One Request ID

When you run language models in production, observability is usually splintered across three disconnected systems. Application APM metrics tell you a route took 850 milliseconds. Upstream vendor dashboards show aggregate token counts hours after the fact. An internal billing ledger can never quite explain why last week's invoice jumped by twenty percent. Debugging a production incident degenerates into manual forensic guesswork: timestamps never align, token totals differ between client and server, and the cost of the failed attempt remains unknown.

A gateway sitting on the inference data plane can measure reality instead of estimation. nRouter mints a cryptographically unique request identifier at the edge for every call — returned as the `x-nr-request-id` response header — and propagates it end to end. That single ID joins the millisecond-accurate timing waterfall, the fallback route decisions, and the immutable spend row into one queryable trace.

## Six stages, one trace

As the request moves through authentication, model alias resolution, preflight safety scoring, and provider dispatch, the gateway tracks it across a structured six-stage pipeline: `llm.request → llm.auth → llm.preflight → llm.provider_call → llm.postflight → llm.inference.persist`. Every served response returns a standardized `x-nr-*` header suite your application reads directly from the response object — request ID, total latency, exact settled cost, cost status, token counts, routing outcome, attempt count, guardrail outcome, cache outcome, compression outcome. No SDK changes, no JSON parsing.

## Waterfalls and ledgers

In the dashboard, the Request Debug & Trace Canvas renders any historical or live request as an interactive waterfall: how many milliseconds went to preflight safety checks, which upstream provider was contacted, whether fallback retries occurred, the exact token breakdown. Failed requests surface bounded machine categories — `RATE_LIMIT_EXHAUSTED`, `CREDIT_EXHAUSTED`, `POLICY_BLOCK` — without exposing customer PII or raw provider credentials.

Every completed or refused request also writes an immutable 22-column row to an append-only spend ledger, down to the exact hundredth of a cent, isolated per tenant and exportable as CSV. Because settlement happens at flat provider list rates with zero token markup, finance can attribute every cent to teams, virtual keys, and end-user identifiers.

## Private telemetry, your own spans

Traces redact payload text and credentials by default — strict zero-prompt retention. And nRouter doesn't export traces to external collectors: you attach the header values to the spans your service already emits with a few OpenTelemetry lines, making one request ID searchable in both your APM and the nRouter logs.

[LLM request tracing](https://nrouter.ai/blog/product/llm-observability)
