GenAI

OpenTelemetry GenAI Semantic Conventions Explained

Spans, metrics and the gaps you have to fill yourself.

The OpenTelemetry GenAI semantic conventions give LLM applications a shared vocabulary: how to name a model call, what to record about tokens, how to measure latency. They are still maturing, so it helps to know what is standard, what is not, and how to build useful dashboards on top. This guide explains the pieces and shows how to try them with synthetic data.

A moving target. The GenAI conventions are marked as under development, and attribute names have been revised between releases. Pin the version of the conventions your instrumentation follows, and check the current names against the specification. OTel Studio follows the names listed in its telemetry reference.

What the conventions cover

AreaWhat it standardisesExamples
SpansOne span per model call, named for the operation and the model, with request and response attributesgen_ai.request.model, gen_ai.response.model, gen_ai.response.finish_reasons, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens
Agent spansA hierarchy for agent frameworks: an agent invocation containing model calls and tool callsAn invoke_agent span with child chat spans
Client metricsToken counts and call duration measured by the callergen_ai.client.token.usage (split by input or output), gen_ai.client.operation.duration
Server metricsLatency measured by the model servergen_ai.server.time_to_first_token, gen_ai.server.time_per_output_token
ContentPrompts and completions, as opt-in events or attributesOff by default because they can hold sensitive data

What the conventions do not cover

Production LLM monitoring needs more than latency and tokens, and several of the things teams care about most have no standard name yet:

OTel Studio puts these in a separate llm.* namespace on purpose — llm.cost.usd, llm.eval.groundedness_score, llm.eval.relevance_score, llm.rag.context_relevance_score, llm.safety.* and llm.agent.* — so that custom signals never masquerade as standard ones. That is good practice for your own instrumentation too: keep your own metrics under your own prefix, and migrate when a standard arrives.

Try it with synthetic data

  1. Start the AI Observability simulator at 30 calls a minute (Simulators → AI Observability). It simulates eight models from five providers.
  2. Run a GenAI scenario beside it — RAG Chatbot or Agent Workflow — to get spans with the span attributes above.
  3. In your backend, plot tokens by model, p95 call duration and time to first token, and spend per hour per model.
  4. Switch on the failure modes one at a time (cost spike, latency spike, high error rate, quality degradation) and check the right panels and alerts react.

The full walkthrough, with a test plan, is in Test GenAI Observability Dashboards.

Design tips

Keep going