Semantic conventions: shared names for spans and attributes

3 min read· Published · Updated View as MarkdownOpen in ClaudeOpen in ChatGPT

Short answer

OpenTelemetry semantic conventions are agreed names for operations and their data: span names, attribute keys and their values, such as http.request.method or error.type. When every library uses the same names, one dashboard or query works across all of them. Each convention has a stability level, and only Stable names are protected from breaking changes.

On this page

OpenTelemetry semantic conventions are the agreed names for spans and attributes, so one query works across every library that follows them.

Two libraries trace the same HTTP call. One writes method=GET, the other http.verb=get. Your dashboard now needs two queries for one thing. Semantic conventions exist so that doesn’t happen.

OpenTelemetry semantic conventions by stability: Stable names such as error.type, Development GenAI names such as gen_ai.agent.id, and hashspan's own blockchain.* namespace.OpenTelemetry semantic conventions by stability: Stable names such as error.type, Development GenAI names such as gen_ai.agent.id, and hashspan's own blockchain.* namespace.

What do the conventions define?

Common names for operations and their data (OpenTelemetry docs). For a span, that means:

Part Example
Span name execute_tool {gen_ai.tool.name}
Attribute key http.request.method, error.type
Attribute value GET, _OTHER
Span kind CLIENT for an outgoing call

They cover traces, metrics, logs, profiles and resources. A backend that knows error.type can group errors from any library that follows the convention.

To check one name, its type and whether it was renamed, search the OpenTelemetry attribute lookup.

Stable or Development?

Every convention has a stability level, and it matters more than the name.

  • Stable. Attributes, metrics and span events can’t be renamed or removed. New attributes can be added (versioning and stability). http.request.method and error.type are Stable.
  • Development. Anything can still change. All the GenAI conventions, invoke_agent, execute_tool and gen_ai.agent.id included, are Development. For what they look like on a real agent run, see the GenAI conventions guide. For the full gen_ai.* list, see the GenAI attribute lookup.
  • Deprecated. Replaced by something else and kept for a while.

The JavaScript package shows the split. Stable names come from the main entry point, Development names from /incubating:

import { ATTR_ERROR_TYPE, ATTR_HTTP_REQUEST_METHOD } from '@opentelemetry/semantic-conventions';
import { ATTR_GEN_AI_AGENT_ID, ATTR_GEN_AI_OPERATION_NAME } from '@opentelemetry/semantic-conventions/incubating';
console.log(ATTR_ERROR_TYPE, ATTR_HTTP_REQUEST_METHOD); // stable
console.log(ATTR_GEN_AI_AGENT_ID, ATTR_GEN_AI_OPERATION_NAME); // development
error.type http.request.method
gen_ai.agent.id gen_ai.operation.name

In version 1.43.0, ATTR_GEN_AI_AGENT_ID is already marked deprecated. The name gen_ai.agent.id didn’t change: the GenAI conventions moved to their own repository in 2026, and the package points there. The package README advises libraries to copy incubating names into their own code instead of importing them at runtime, since minor versions can break them.

What if there’s no convention for your domain?

Pick a namespace and treat it as a public API. Renaming an attribute later breaks someone’s dashboard, the same way a renamed function breaks someone’s build.

FAQ

Where can I look up an OpenTelemetry attribute name?

In the hashspan OpenTelemetry attribute lookup at /learn/otel-attributes. It lists each attribute with its type, stability and any rename, and links the official definition.

Where are the OpenTelemetry semantic conventions on GitHub?

The main set is in open-telemetry/semantic-conventions. The GenAI conventions moved to their own repository, open-telemetry/semantic-conventions-genai, in 2026.

What do the stability levels mean?

Development conventions can still be renamed or removed. Stable ones can't: attributes, metrics and span events keep their names, and new attributes can only be added.

Can I define my own attributes?

Yes. Put them in a namespace of your own so they can't collide with current or future standard names, and reuse standard attributes such as error.type where they fit.

Something wrong or out of date? Report a problem with this page.

Go further

Type to search the docs, Learn topics and the blog.