Skip to content
Rapid Router
← API reference

Tracing

Part of the Rapid Router API reference. One OpenAI-compatible endpoint, https://rapidrouter.ai/api/v1, in front of every model in the catalog.

40Tracing

Every response carries two correlation headers. x-request-id is the gateway's own id for the request, the same one a 5xx error body references, so quoting it in a support report points us at the exact log line. traceparent is a W3C trace context header: if your request already carried a valid traceparent, the gateway joins your trace, keeping your trace id and answering with a fresh span id; if it did not, the gateway starts a new trace. Either way your tracing backend and our logs end up speaking about the same trace id.

# Send a traceparent and the gateway propagates your trace id:
curl -sD - -o /dev/null https://rapidrouter.ai/api/v1/models \
  -H "traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"

# <- x-request-id: req_...
# <- traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-<fresh span id>-01

Self-hosted collectors. Two environment variables on the gateway turn on span export: OTEL_EXPORTER_OTLP_ENDPOINT makes the gateway POST one span per request, in OTLP/HTTP JSON, to <endpoint>/v1/traces in 5 second batches, and OTEL_EXPORTER_OTLP_HEADERS (comma-separated key=value pairs) adds auth headers for the collector. This is gateway-side tracing of the HTTP request itself: method, route, status and timing. Prompt and completion bodies are never in spans.