What does setting TRACELOOP_TRACE_CONTENT=false change in OpenLLMetry spans?
answer
- Capture is on unless you turn it off
- Payload goes, metadata stays
- One process-wide switch, no per-request control
- Unset means capturing
- Not retroactive for spans already exported
basics
~20 sIt stops OpenLLMetry recording prompt and completion message text on spans. Metadata still flows: provider, model, token counts, parameters, latency and errors. Content capture is on by default, so this is the switch a regulated team flips.
solid answer
~50 sOpenLLMetry records the actual messages by default — the prompt you sent and the completion that came back land on the span as attributes. Setting the environment variable `TRACELOOP_TRACE_CONTENT` to `false` turns that off while leaving everything else intact: you keep `gen_ai.provider.name`, `gen_ai.request.model`, `gen_ai.request.temperature`, `gen_ai.usage.input_tokens` and `gen_ai.usage.output_tokens`, span duration, and error status. In other words you keep every cost, latency and reliability dashboard, and you lose the ability to read what the model was asked and what it said. The important properties are that it is process-wide (not per-request), it is read as configuration rather than per-call code, and it is **not retroactive** — spans already exported with content stay in the backend under whatever retention it has. If you need finer control than on/off, the alternative is a custom span processor that redacts or hashes the content attributes before export.
code
bash · 4 lines# Disable prompt/completion capture for the whole process.
# Metadata (model, tokens, latency, errors) is still recorded.
export TRACELOOP_TRACE_CONTENT=false
python -m myapp.servergo deeper
Remember the direction of the default: OpenLLMetry records prompt and completion text unless TRACELOOP_TRACE_CONTENT is set to false. Be able to say what survives the toggle — model, tokens, latency, errors.
Explain exactly which attributes disappear and which remain, and note that the switch is process-wide environment configuration, so there is no per-request or per-user granularity to reach for.
Bring the operational consequences: unset fails open, the change is not retroactive so already-exported spans need cleanup, and a span processor that redacts or hashes content is the middle ground between all and nothing.
Frame it as a data-classification decision with a cost dimension — which environments and which services may hold payloads at all, how that is enforced in deployment manifests rather than developer shells, and what retention and access the trace store must offer before you allow capture.
## The default is to record everything This is the single most important fact about OpenLLMetry's content behaviour: prompt and completion text is captured by default. The library's purpose is debugging LLM applications, and the payload is what you actually want to see when an answer is wrong. So an unconfigured install of the SDK, dropped into a service that processes customer messages, medical notes or payment disputes, ships that text to your tracing backend. Nobody has to opt in for it to happen. ## What the toggle does Setting the environment variable `TRACELOOP_TRACE_CONTENT` to `false` disables recording of the message payload. Concretely: **Still recorded:** provider, operation, request and response model, sampling parameters such as temperature and max tokens, `gen_ai.usage.input_tokens` and `gen_ai.usage.output_tokens`, span name, start and end time, parent/child structure, exception and status information, plus your own workflow and task span names. **No longer recorded:** the prompt messages and the completion messages — the content attributes that carry the role and text of each turn. That split is the answer to the question an interviewer usually asks next: what do you lose? You keep every quantitative view — cost by model, p95 latency, error rate, throughput — and you lose qualitative debugging. "This request cost 4,100 input tokens and took 9 seconds" survives; "and here is the 4,100-token prompt that caused it" does not. ## Its granularity, and why that matters The toggle is environment configuration, so it applies to the whole process for its lifetime. There is no per-request switch: you cannot record content for internal users and suppress it for customers within a single process. The practical consequence is architectural — if only some traffic may be captured, you separate it into different deployments with different configuration, rather than trying to branch inside one service. Being configuration rather than code also means it is easy to get wrong in the direction that hurts. A missing environment variable in one environment fails **open**: content is captured. Compare that with a secret, where a missing value fails closed and you find out immediately. So the toggle belongs in the same tier of review as any other security-relevant default: asserted in deployment manifests, not left to a developer's shell. ## Not retroactive Turning it off stops future spans from carrying content. Spans already exported are in the backend, subject to that backend's retention and access controls. An incident response after accidental capture therefore has two parts: change the configuration, and then deal with the data already stored — deleting the affected traces, or waiting out retention if deletion is not supported, and recording the exposure. Saying this out loud in an interview is a strong signal, because it is the part teams forget. ## When plain on/off is not enough Common middle grounds: - **Redact in a span processor.** Attach a custom OpenTelemetry span processor that rewrites or drops the content attributes before export — for example replacing detected identifiers, or storing only a hash so you can tell whether two requests carried the same prompt without holding the text. - **Store content elsewhere.** Keep an application-side reference (a record id) on the span and put the payload in a system that already has the right access controls, retention and deletion workflow. The trace then links to evidence instead of being the evidence. - **Separate deployments by data class.** Content on for the internal or synthetic-data tier, off for regulated traffic. - **Turn it on temporarily.** Capture content in a staging environment reproducing the bug, rather than in production. ## What content capture costs even when it is allowed Even with no privacy constraint, payloads dominate span size. A RAG prompt with several retrieved chunks can be tens of kilobytes; multiply by request volume and content is usually the majority of your LLM tracing bill, and the reason spans get truncated or rejected by ingestion limits. So the toggle is a cost lever as well as a privacy lever, and "we turned content off in the highest-volume service and kept it on in the low-volume ones" is a perfectly respectable production answer. ## The interview shape Expect the question as a scenario: "you added LLM tracing to a service handling personal data — what did you check first?". The complete answer is: capture is on by default, `TRACELOOP_TRACE_CONTENT=false` turns it off, metadata survives so your dashboards do not, the setting is process-wide and fails open when unset, it does not clean up what was already sent, and redaction in a span processor is the option when you need something between all and nothing.
- With content capture disabled, which dashboards keep working and which break?Everything quantitative keeps working: cost from the token usage attributes, latency percentiles, throughput, error rate, and per-model comparisons all come from metadata that is still recorded. What breaks is qualitative debugging — you can see that a call was slow and expensive, but not the prompt that made it so, and you cannot build offline eval datasets by harvesting production prompts from traces.
- You discover content was captured for two weeks in a service that should never have recorded it. What are the steps?Two tracks. First stop the bleeding: set the toggle off and redeploy, then verify on a live span that content is gone. Second, handle stored data: identify affected traces in the backend, delete them if the product supports it or wait out retention if not, check who had access, and record the exposure through whatever incident process applies. The configuration change alone is not remediation.
- You need content for internal users but not for customers, in the same service. What do you do?Do not try to branch on it inside one process — the toggle is process-wide. Either split the traffic into separate deployments with different configuration, or leave capture on and attach a custom span processor that drops or redacts the content attributes for spans that are not marked internal. The processor route keeps one deployment but puts the redaction rule in code you must test.
- Is disabling content capture purely a privacy decision?No — it is also a cost and reliability lever. Prompt and completion text usually dominates span size, especially with retrieved context, so content is often most of the tracing bill and the reason large spans get truncated or rejected at ingestion. Turning it off in the highest-volume service while keeping it in low-volume ones is a common, defensible production compromise.
saying these in an interview costs you the question
- Assumes content is not captured unless you opt in
- Thinks turning it off also removes token and latency data
- Believes the toggle works per request or per user
- Expects the setting to purge spans already exported
- Treats it as a debug nicety rather than a data-handling control