🐛 Bug Report: OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT is ignored, only TRACELOOP_TRACE_CONTENT disables content capture

Aperta
#4,691 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@yuee3 ci sta già lavorando.

Dal 5/11/2026.

  • #4693 di @yuee3 — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start by reading the content-capture helpers in openai/utils.py:202 and anthropic/utils.py:32, then inspect watsonx/utils.py:45 and how the instrumentation packages add message attributes to spans. Determine how a shared helper could honor the OTel variable while retaining the Traceloop variable as a fallback, and identify the default behavior that needs a decision. Done means the standard variable disables message attributes across instrumentations and tests cover both variables and the chosen default.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug python
Which component is this bug for?

All instrumentations

📜 Description

Content capture (prompts and completions) can only be turned off with the Traceloop-specific TRACELOOP_TRACE_CONTENT env var, which 24 instrumentation packages read with a default of "true" (for example openai/utils.py:202, anthropic/utils.py:32). The standard OTel GenAI variable OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT is ignored, so users following the OTel docs still send prompt and completion content, which may contain PII.

watsonx defines is_content_enabled() reading the OTel variable (watsonx/utils.py:45), but nothing calls it.

👟 Reproduction steps
  1. export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=false
  2. Run any instrumented LLM call (for example OpenAI chat) with a console exporter
👍 Expected behavior

No gen_ai.input.messages / gen_ai.output.messages on the span.

👎 Actual Behavior with Screenshots

Both attributes are present with the full prompt and completion. Only TRACELOOP_TRACE_CONTENT=false removes them.

🤖 Python Version

3.12

📃 Provide any additional context for the Bug.

Suggested fix: one shared helper (for example in opentelemetry-semantic-conventions-ai) that honors OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT and keeps TRACELOOP_TRACE_CONTENT as a fallback, used by every package instead of the per-package copies. The default (on vs off when neither is set) needs a decision: the OTel convention is off by default, today it is on.

Lingua principale
Python
Stelle
7.5k
Fork
1.2k
Merge medio
1g 23h
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di traceloop/openllmetry

Tutte le issue di traceloop/openllmetry

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.