Your AI traces are less portable than you think
On November 21, OpenTelemetry tagged v0.1.0 of its GenAI semantic conventions. These conventions are the shared names that tracing tools use to describe a model call: which provider, which model, how many tokens, what went in, and what came out. This is the first release from their own repository. It also renames several attributes and changes how agent workflows are recorded.
Our own Observability chapter teaches OpenTelemetry for one reason: instrument once, export anywhere. You add tracing to your code one time, and you can send the same traces to Jaeger, LangSmith, or a paid platform without changing that code.
I do not run a tracing tool every day. I have used Langfuse and LangSmith in the past, and I build a lot of demos, so I use whichever tool the customer already leans toward. That is exactly the case "export anywhere" is meant for. The code stays the same, and only the backend changes.
So I tested it. One request, two popular libraries, four traces with four different shapes. Two of those traces also stored a test customer's email address without me asking.
Here is what I found. OpenTelemetry moves the traces, but the attribute names inside them still depend on which instrumentation library you use and which version. I sent one request through two common libraries, each set up two ways, and got four different span shapes. Both setups of one library recorded the user's email address by default. The GenAI conventions are still marked "Development", and the November 21 release renamed more attributes. So pin your instrumentation versions, look at one real span from each library before you pick or switch a backend, turn prompt capture off in production unless you chose to keep it, and add agent and tool spans yourself, because a model client only sees model calls.
I wanted to know how true "export anywhere" is today. I broke it down into four questions:
- What did the November 21 release change?
- If I use OpenTelemetry, will my traces look the same in any backend?
- Are prompts and user data ending up in my traces?
- What should an agent trace show beyond the model call?
What did the November 21 release change?
Until this year, the GenAI conventions lived in the main OpenTelemetry semantic conventions repository with everything else, such as HTTP and databases. In v1.42.0 (June 12, 2026), they moved to a dedicated repository. v0.1.0 is the first release from that repository, and it builds on the main conventions at v1.45.0.
The changelog lists several breaking changes. The ones I would notice first:
- Workflow spans now use the same agent span type.
gen_ai.workflow.nameis replaced bygen_ai.agent.name, and the operation name staysinvoke_workflow. gen_ai.usage.cache_creation.input_tokensis nowgen_ai.usage.cache_write.input_tokens.- The provider value
mistral_aiis nowmistral. - The single token usage histogram is split into separate input and output token metrics, and durations move to dedicated metrics per operation.
This is not the first rename. In v1.37.0 (August 25, 2025), gen_ai.system became gen_ai.provider.name, and the old per-message events were replaced by gen_ai.input.messages and gen_ai.output.messages attributes. Every page in the new repository is still marked "Development", and the version number starts at 0.1.
My take is that these names will keep moving for a while. That is normal for a young standard, but it changes how you should treat them. I would treat them like an API that has not reached 1.0 yet: pin the versions you use, and read the changelog before you upgrade.
Will my traces look the same in any backend?
To check this, I ran a small test. I started a fake model server on my machine that always returns the same answer, so the model could not change between runs. Then I sent the same request through two libraries, each set up two ways, for four setups in total. Each request had a system prompt and this user message: "Where is order 1042? My email is [email protected]".
- OpenLLMetry 0.63.1 with its Ollama instrumentation. This is the library and package our Observability lab uses.
- OpenLLMetry 0.63.1 with its OpenAI instrumentation.
- The official OpenTelemetry instrumentation for OpenAI,
opentelemetry-instrumentation-openai-v22.4b0, with its defaults. - The same official package with
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimentalset.
All four sent spans through the standard OpenTelemetry SDK. Here is what came out:
| Setup | Span name | Provider attribute | Prompt attribute | Prompt text recorded by default |
|---|---|---|---|---|
| 1. OpenLLMetry, Ollama | ollama.chat | gen_ai.system | gen_ai.prompt.1.content | Yes |
| 2. OpenLLMetry, OpenAI | openai.chat | gen_ai.provider.name | gen_ai.input.messages | Yes |
| 3. Official, defaults | chat gpt-demo | gen_ai.system | none | No |
| 4. Official, latest | chat gpt-demo | gen_ai.provider.name | gen_ai.input.messages, only when turned on | No |
Here is part of the real span from setup 1:
{
"name": "ollama.chat",
"attributes": {
"llm.request.type": "chat",
"gen_ai.request.model": "llama3.2",
"gen_ai.prompt.1.role": "user",
"gen_ai.completion.0.content": "Order 1042 shipped on Nov 28.",
"llm.usage.total_tokens": 40,
"gen_ai.usage.input_tokens": 31,
"gen_ai.usage.output_tokens": 9,
"gen_ai.system": "Ollama"
}
}
And the same call from setup 4:
{
"name": "chat gpt-demo",
"attributes": {
"gen_ai.operation.name": "chat",
"gen_ai.request.model": "gpt-demo",
"gen_ai.provider.name": "openai",
"gen_ai.response.finish_reasons": ["stop"],
"gen_ai.response.model": "gpt-demo",
"gen_ai.response.id": "chatcmpl-demo",
"gen_ai.usage.input_tokens": 31,
"gen_ai.usage.output_tokens": 9
}
}
Two things surprised me.
First, the same project gave two different shapes. OpenLLMetry's OpenAI package already uses the newer names. Its Ollama package, from the same 0.63.1 release on November 16, still uses gen_ai.system, gen_ai.prompt.*, and llm.*. It also does not set gen_ai.operation.name or gen_ai.provider.name, which the current conventions mark as required.
Second, the official package is not on the latest names by default either. Its own documentation says it follows the conventions from v1.30.0, a release from January 2025, unless you set the opt-in variable.
So what does this mean in practice? A dashboard that filters on gen_ai.provider.name = "openai" will miss every span from setup 3. A backend that shows prompts from gen_ai.input.messages will show nothing for setup 1. A backend may map older names to newer ones for you, but I would check that for your backend rather than assume it. I did not load these spans into Langfuse or LangSmith for this post, so I cannot say how each of them handles the older names.
I also want to be candid about our own chapter. The Observability lab uses OpenLLMetry's Ollama instrumentation, so its spans use the older names. They still teach spans and traces well, but they are not what the current conventions describe.
The remedy
- Pin every instrumentation package. A minor upgrade can change attribute names, so upgrade on purpose and compare a span before and after.
- Opt in on the official packages. Set
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimentalif you want the newer names, and expect them to keep changing. - Look at one real span from every package you use. You do not need a backend for this. I used this small check on each span in my test:
REQUIRED = ["gen_ai.operation.name", "gen_ai.provider.name"]
OLDER_NAMES = ["gen_ai.system", "gen_ai.prompt.", "gen_ai.completion.", "llm."]
CONTENT = ["gen_ai.input.messages", "gen_ai.output.messages",
"gen_ai.system_instructions", "gen_ai.prompt.", "gen_ai.completion."]
def check_span(name, attributes):
keys = list(attributes)
missing = [k for k in REQUIRED if k not in keys]
older = sorted({p for p in OLDER_NAMES for k in keys if k.startswith(p)})
content = sorted({p for p in CONTENT for k in keys if k.startswith(p)})
print(f"Span: {name}")
print(f" Missing required: {missing or 'none'}")
print(f" Older names: {older or 'none'}")
print(f" Prompt or output text recorded: {'YES ' + str(content) if content else 'no'}")
In plain words, it takes a span's name and attributes, and reports three things: which required attributes are missing, which older names are present, and whether any prompt or output text was recorded. I called it from a small custom exporter, but you can also paste in the attributes from any span you copy out of a backend. Here is the output for setups 1 and 4:
Span: ollama.chat
Missing required: ['gen_ai.operation.name', 'gen_ai.provider.name']
Older names: ['gen_ai.completion.', 'gen_ai.prompt.', 'gen_ai.system', 'llm.']
Prompt or output text recorded: YES ['gen_ai.completion.', 'gen_ai.prompt.']
Span: chat gpt-demo
Missing required: none
Older names: none
Prompt or output text recorded: no
- If you must mix libraries, fix the names in one place. The OpenTelemetry Collector is a service that receives traces and forwards them to your backend. Its transform processor can copy a value to a new attribute name and delete the old one, with
set(...)anddelete_key(...)statements, so every backend sees one set of names. I have not run that setup myself for this post.
Are prompts and user data ending up in my traces?
The table above already showed this. In setups 1 and 2, the test email address went into the span without me asking for it.
The conventions are clear about this. Prompt and response attributes are "Opt-In", and the spans document says instrumentations "SHOULD NOT capture them by default". The same applies to tool call arguments and results on tool spans, and the spec warns that all of these may contain sensitive information.
The official package follows that. It records no content unless you set OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT. OpenLLMetry does the opposite. Its setting, TRACELOOP_TRACE_CONTENT, defaults to "true" in the source code of both packages I tested. When I set it to false, the prompt and output text disappeared from both spans.
Why does this matter? Traces usually go to a separate system, often a vendor, with its own retention and its own list of people who can read it. That list is often longer than the list of people who can read your application database. A support agent that handles customer messages will put names, emails, and order details into every span.
I am not saying content capture is wrong. Seeing the exact prompt next to the answer is the most useful part of a trace when you debug, and our chapter shows exactly that. The point is that it should be a decision, not a default you inherited.
The remedy
- Decide per environment. Keep content on in development, where the data is your own. In production, turn it off unless you have a reason and a plan for that data.
- Check each library's switch. For OpenLLMetry, set
TRACELOOP_TRACE_CONTENT=false. For the official packages, leaveOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTunset. - If you need content in production, store it separately. The official package documents an upload option,
OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK=upload, withOTEL_INSTRUMENTATION_GENAI_UPLOAD_BASE_PATHpointing at storage you control. It uploads prompts and responses there and records a link in the span, asgen_ai.input.messages_refandgen_ai.output.messages_ref. With content capture left off, the trace backend never holds the text. I did not test this option. - Add a backstop. The Collector's redaction processor can mask attribute values by key pattern, so a library that ignores your setting still cannot ship prompt text. As with the transform processor, I have not run this setup myself.
What should an agent trace show beyond the model call?
Every span in my test was a single model call, because that is all a model client library can see. In an agent, the problem is often somewhere else: the tool that returned the wrong record, or the third trip around the loop.
The agent spans document covers that larger picture. An invoke_agent span wraps one agent run. Each model call is a chat span inside it, and each tool call is an execute_tool {tool name} span. The gen_ai.tool.call.id attribute links the model's request for a tool to the span that ran it.
The model client instrumentation gives you the chat spans. The agent and tool spans have to come from your agent framework or from your own code.
The remedy
If your framework does not emit agent and tool spans, a few lines with the plain OpenTelemetry API are enough:
from opentelemetry import trace
tracer = trace.get_tracer("support-agent")
def run_agent(messages):
with tracer.start_as_current_span("invoke_agent support-agent") as agent_span:
agent_span.set_attribute("gen_ai.operation.name", "invoke_agent")
agent_span.set_attribute("gen_ai.agent.name", "support-agent")
while True:
response = call_model(messages) # the model client's own instrumentation adds the chat span
if not response.tool_calls:
return response.text
for call in response.tool_calls:
with tracer.start_as_current_span(f"execute_tool {call.name}") as tool_span:
tool_span.set_attribute("gen_ai.operation.name", "execute_tool")
tool_span.set_attribute("gen_ai.tool.name", call.name)
tool_span.set_attribute("gen_ai.tool.call.id", call.id)
result = run_tool(call)
messages = add_tool_result(messages, call, result)
call_model, run_tool, and add_tool_result stand in for your own code. I ran it with simple stand-ins, and the trace came out as one agent span holding a chat span, an execute_tool lookup_order span, and a second chat span.
Add a step limit to that loop before you run it for real. The token budget post shows one.
What this means for practitioners and architects
If you are choosing an observability tool for an LLM app or an agent, or already running one, I would suggest five things:
- Treat the GenAI attribute names as a pre-1.0 API. Pin every instrumentation package and read the changelog before each upgrade.
- Look at real spans before you choose or switch a backend. Run one request through each library you use and check the names, not the marketing page.
- Make prompt capture a decision. Check each library's default, turn content off in production unless you have a plan for it, and add a redaction backstop.
- Trace the agent, not only the model. Add
invoke_agentandexecute_toolspans with the tool call ID, so you can see what happened between model calls. - Fix names in one place if you mix libraries. A Collector in front of your backend is a better place to rename attributes than every service.
For the basics of spans, traces, and exporters, see the Observability chapter. For what to do with the cost data these spans carry, see Production Concerns.
"Instrument once, export anywhere" is still the right goal, and OpenTelemetry is still the right base. Today, though, it is more like instrument once, check the names, then export anywhere.
Have you moved LLM traces between tools, or found prompts in traces where you did not expect them? Leave a comment below and share what worked for you, and what did not.
Comments
Comments are provided by Giscus and GitHub. Loading them connects your browser to GitHub, and GitHub's privacy terms apply.