# Otel genai conventions

The OpenTelemetry GenAI semantic conventions are a shared vocabulary for describing an LLM call,
a tool call, or an agent step as a span. They fix the span names and the attribute names, so a
trace from one framework means the same thing as a trace from another, and a backend can read
both without a per-framework adapter.

The shape is one span per operation. An attribute called gen_ai.operation.name says what kind of
operation it was: a chat call, an embedding, a retrieval, a tool execution, an agent invocation.
An LLM span carries the provider, the model name, and the token counts. A tool span carries the
tool's name and the id of that particular call. Grouping spans into a session or a user uses the
general OpenTelemetry attributes, session.id and user.id, not a GenAI-specific one.

Two things to know before building on them. They are not stable yet. Every GenAI span, metric,
and attribute is still marked as in development, and names have already changed once:
gen_ai.system became gen_ai.provider.name, so both spellings are live in the wild and anything
reading them has to accept either. And the message content is opt-in. The input and output
messages are off by default because they carry whatever the user typed, and how they should be
recorded, as span attributes or as separate events, is the part still moving.

Export is OTLP, over HTTP or gRPC. The payload is the same either way; pick whichever your
collector already speaks.

## Questions answered under this concept

- [Are LLM prompts and completions captured by OpenTelemetry's GenAI conventions by default?](https://tessary.ai/answers/otel-genai-conventions/are-llm-prompts-and-completions-captured-by-default)
- [Does OpenTelemetry capture the model's output when a GenAI call ends in an error?](https://tessary.ai/answers/otel-genai-conventions/does-opentelemetry-capture-output-on-a-failed-genai-call)
- [Does OpenTelemetry identify the top-level agent in a multi-agent system?](https://tessary.ai/answers/otel-genai-conventions/does-opentelemetry-identify-the-top-level-agent)
- [Does OpenTelemetry record which agent skill caused a bad response?](https://tessary.ai/answers/otel-genai-conventions/does-opentelemetry-record-which-agent-skill-caused-a-bad-response)
- [How do I capture prompts and completions without leaking PII?](https://tessary.ai/answers/otel-genai-conventions/how-do-i-capture-prompts-and-completions-without-leaking-pii)
- [What are the OpenTelemetry GenAI semantic conventions?](https://tessary.ai/answers/otel-genai-conventions/what-are-the-opentelemetry-genai-semantic-conventions)
- [Which attributes should an agent emit on an LLM span?](https://tessary.ai/answers/otel-genai-conventions/which-attributes-should-an-agent-emit-on-an-llm-span)
- [Why did OpenTelemetry split its token-usage metric into separate counters?](https://tessary.ai/answers/otel-genai-conventions/why-did-opentelemetry-split-its-token-usage-metric-into-separate-counters)
- [Why was gen_ai.system renamed to gen_ai.provider.name?](https://tessary.ai/answers/otel-genai-conventions/why-was-gen-ai-system-renamed-to-gen-ai-provider-name)

---

Source: https://tessary.ai/answers/otel-genai-conventions
All concepts: https://tessary.ai/answers
From Tessary, agent reliability for AI agents in production: https://tessary.ai
