Services

Resources

Company

/

GenAI semantic conventions

GenAI semantic conventions

GenAI semantic conventions are the OpenTelemetry standard names for telemetry about generative AI, such as model calls, token usage, tool calls and agent runs. They define attributes in the gen_ai.* namespace, plus operation names and metrics. They now live in their own repository, open-telemetry/semantic-conventions-genai, and are still marked Development.

How it works

A span for a model call carries attributes such as gen_ai.operation.name, gen_ai.request.model, gen_ai.response.model, gen_ai.provider.name and gen_ai.usage.input_tokens. Agent runs use operation names such as invoke_workflow, invoke_agent, chat and execute_tool. Libraries emit metrics such as gen_ai.client.token.usage and gen_ai.client.operation.duration today. Newer drafts replace them with gen_ai.client.inference.* metrics.

Why it matters in production

Shared names let you switch instrumentation libraries or backends without rewriting every dashboard query. Because the conventions are still in Development, names and labels can change between releases. Pin library versions and expect to update dashboards when you upgrade.

See also

References

  1. Origin of the term

  2. OpenTelemetry GenAI semantic conventions

  3. OpenTelemetry semantic conventions overview

Trace of one agent run under the GenAI semantic conventions: an invoke_agent span holds chat, execute_tool and a second chat span. The first chat span carries gen_ai.operation.name = chat, gen_ai.request.model, gen_ai.provider.name and gen_ai.usage.input_tokens. Below, the metric gen_ai.client.token.usage points to gen_ai.client.inference.* in red: newer drafts rename it, so pin versions and fix dashboards.

Putting this into practice?

Talk to One2N about our AI engineering services

Talk to One2N about our AI engineering services