OpenTelemetry for GenAI

ProductionObservabilityPublished By Simon Budziak

OpenTelemetry for GenAI is a set of open conventions that define how large language model operations are recorded as telemetry, giving every inference call, retrieval step, and tool execution standard attribute names so any compliant backend can read the resulting traces without custom mapping.

The conventions specify shared attribute names for a GenAI span: which provider served the request, which model ran, input and output token counts, and the finish reason. They also define standard span types for embeddings, retrieval, memory, and tool execution, plus metrics for duration and token usage.

Why does OpenTelemetry for GenAI matter?

Before the conventions stabilized, every tracing platform invented its own span format, so changing vendors meant rewriting instrumentation. Emitting standard GenAI attributes keeps your trace data portable, because open source and commercial backends alike can ingest it directly. The same instrumentation also captures the non-model steps, so retrieval and tool calls land in one trace beside every model call.

What does a GenAI span actually contain?

An inference span records the operation name, provider, requested model, token usage, and sampling settings such as temperature. Retrieval spans capture the query and the documents returned; tool spans record the arguments sent and results received. Together these spans form one complete execution record, feeding LLM tracing pipelines and giving an audit trail that guardrails checks can cite.

Frequently asked questions

Do I have to rewrite my application to adopt OpenTelemetry for GenAI?

No. Most instrumentations attach to existing model client libraries automatically, and major tracing platforms accept OpenTelemetry spans alongside their native formats.

Are the GenAI conventions finished?

Core attributes for inference, token usage, and provider identification are widely implemented today, while newer areas such as agent operations continue to be defined through the open governance process.

Summarize this page with

Train your team to build this