Skip to content
sinc-LLMBook a 15-minute call

How to Trace GenAI Requests Without Logging Prompt Content

Keep GenAI timing, outcomes and usage visible in OpenTelemetry while testing that prompt and completion content stays out of stored telemetry.

On this page

By Mario Alexandre · November 29, 2026 · 3 min read

Use OpenTelemetry GenAI spans for timing, outcome, token usage and correlation while keeping prompts and model output out of the telemetry pipeline. Set content capture explicitly in the installed instrumentation and inspect what reaches storage. If you cannot inspect a signal or destination used by the route, treat exclusion there as unverified.

The OpenTelemetry GenAI semantic conventions release v0.1.0 recommends that instrumentation omit model instructions, user messages and model outputs by default and offer an explicit opt-in. Official source

That statement describes the pinned convention. Record the separate versions of the SDK, instrumentation package, optional framework wrappers and collector configuration. An integration may implement a different convention revision or still emit its own fields. The inspection that matters is what those exact deployed components emit in your route.

Give each field an incident question

Question Evidence to collect When the value is missing
Which request should I inspect? Trace and span IDs plus an approved opaque request correlation value where needed Check context propagation and safe ID mapping
Where was time spent? Parent and child span timing and operation name Check whether the span covers a logical operation or one attempt
Which inference failed? Provider, model and a bounded outcome or error category Inspect the installed library’s error mapping using a controlled failure
Did token use change? Input and output token counts when reported Keep the value missing and report coverage when aggregating

The pinned client inference convention defines gen_ai.usage.input_tokens and gen_ai.usage.output_tokens for provider-reported token counts on inference spans. Official source

The pinned GenAI span guidance measures the caller’s logical operation through full receipt, cancellation or error, and says automatic retries should fall within that operation span. Official source

Keep a provider response ID distinct from your application request ID and trace ID. If provider tickets require another request identifier, retain it only where its use and access are approved. Keep request-specific IDs out of metric dimensions. Tie dashboards to the actual field names and units emitted by your installed version, and verify what an incomplete streamed operation reports before interpreting empty usage fields.

Verify every path that can retain content

Disable capture at the instrumentation source. Inspect framework events, exception details, HTTP body diagnostics, custom span names, logs and optional content-upload hooks. Check collector processing and every exporter route, including destinations used during retries or debugging. OpenTelemetry documents collector processors that can remove selected attributes or drop attributes outside an allowlist. Official source

Use collector filtering as another checkpoint. A collector rule only covers the traffic it receives and the fields it processes. Search for full values as well as content references and alternative names. If one application logger writes to a separate sink, inspect that route directly. Use the test trace ID to establish that its exception record arrived before interpreting any missing content marker.

Run a synthetic leak test

In an illustrative checkout assistant, use distinguishable synthetic strings for the user input, system instructions and model output. Exercise a success, a streaming completion and a controlled failure that emits an error after receiving input. Run the same test for instrumented tool calls if they share the trace. Use an isolated receiver with known sampling and confirm that expected metadata and each test trace are visible before interpreting an absence.

Prove the detector works by putting a synthetic marker into a local test export and verifying that the check catches it. With the intended configuration, inspect app output, exported spans and events, collector output and stored logs for the markers and known content-bearing fields. Accept the route when the incident metadata remains visible and those content paths are clear in the observed signals. Recheck when instrumentation or routing changes. LLM observability metrics for production