OpenTelemetry Semantic Conventions

OTel span attribute keys for HTTP, DB, RPC, messaging, exceptions and more.

Searchable OpenTelemetry semantic convention attribute reference with namespace, type and stability status. Look up the canonical OTel attribute key for traces, metrics and logs. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What are OpenTelemetry semantic conventions?

They are a standardized set of attribute names and values for telemetry data so that traces, metrics and logs from different systems are consistent and queryable. For example, every HTTP server span uses http.request.method rather than a custom per-vendor key.

OpenTelemetry semantic conventions reference

OpenTelemetry semantic conventions define the canonical names and value formats for attributes attached to spans, metrics, and logs. Using them means a query like db.system = postgresql works the same whether the data came from a Java, Go, or Python service. This reference lists common attribute keys, the namespace they belong to, their value type, and stability status.

Filter by key or namespace below to find the right attribute name for your instrumentation.

How it works

Attributes are namespaced dotted keys (http., db., rpc., messaging., network., server.). The OpenTelemetry specification fixes both the name and the expected value — for instance http.request.method must be an uppercase token like GET, and db.system uses a known identifier like postgresql or mysql. Each attribute carries a stability marker: Stable keys are frozen, Experimental keys may still change, and Deprecated keys point to a replacement.

Exceptions are modeled as a span event named exception carrying exception.type, exception.message, and exception.stacktrace. Resource attributes (service.name, service.version, telemetry.sdk.name) describe the producing entity and apply to every signal it emits. Following the conventions is what makes vendor-neutral dashboards and alerting possible.

Key attribute namespaces at a glance

HTTP attributes (stable)

AttributeTypeExample value
http.request.methodstring"GET", "POST" (uppercase)
http.response.status_codeint200, 404
url.fullstring"https://api.example.com/v1/orders"
url.pathstring"/v1/orders"
url.schemestring"https"
server.addressstring"api.example.com"
server.portint443
network.protocol.versionstring"1.1", "2"

Database attributes

AttributeTypeExample value
db.systemstring"postgresql", "mysql", "redis"
db.namestring"orders_db"
db.operationstring"SELECT", "INSERT"
db.statementstring"SELECT * FROM orders WHERE id = ?"
db.userstring"app_user"
server.addressstringDatabase host
server.portint5432 (PostgreSQL default)

RPC attributes

AttributeTypeExample value
rpc.systemstring"grpc", "jsonrpc", "dotnet_wcf"
rpc.servicestring"OrderService"
rpc.methodstring"GetOrder"
rpc.grpc.status_codeint0 (OK), 14 (UNAVAILABLE)

Exception event attributes

event name: "exception"
exception.type       = "java.lang.NullPointerException"
exception.message    = "Cannot invoke method getId() on null"
exception.stacktrace = "<full stack trace string>"

Migration: old vs new HTTP keys

Many codebases still use the pre-stable HTTP convention names. These are now deprecated:

DeprecatedCurrent stable equivalent
http.methodhttp.request.method
http.status_codehttp.response.status_code
http.urlurl.full
http.hostserver.address
http.flavornetwork.protocol.version

During migration, emit both old and new keys for one release cycle so existing dashboards and alerts keep working while you update queries.

Tips and examples

A typical HTTP server span carries:

http.request.method = "GET"
url.path = "/api/orders"
http.response.status_code = 200
server.address = "api.example.com"
network.protocol.version = "1.1"

Prefer the SDK’s helper methods (setAttribute, recordException) over hand-writing keys to avoid typos. Stick to Stable attributes for production alerting; treat Experimental ones as best-effort. Always set service.name as a resource attribute so every signal from your service is correctly identified in your observability backend.