http.connection.state
stringDevelopment
State of the HTTP connection in the HTTP connection pool.
Values active, idle
The http.* attributes describe one HTTP request: http.request.method, http.response.status_code, http.route on servers, and request and response headers when you opt in. The core ones are Stable. Older names such as http.method, http.status_code and http.url are deprecated, and http.url became url.full.
An HTTP client span is named {method} {target}, or just {method} when there is no low-cardinality target. The target is url.template on a client and http.route on a server. The URL path is never the default target.
A request with a method the instrumentation does not know gets http.request.method _OTHER, the real method in http.request.method_original, and the span name HTTP.
The address of the other side is not an http.* attribute: it is server.address and server.port, shared with RPC and GenAI spans.
Every span in the conventions that references at least one of these attributes, with the span name it should get and its kind.
{method} {target}CLIENThttp.client{method} {target}SERVERhttp.serverIf it does, the spans come from instrumentation that writes the old names. They are listed under the deprecated attributes below, each with its replacement: http.method is now http.request.method, http.status_code is http.response.status_code, http.url is url.full.
If a dashboard has to work across both, query both names until every service is upgraded.
http.* attributeshttp.connection.statestringDevelopment
State of the HTTP connection in the HTTP connection pool.
Values active, idle
http.request.body.sizeintDevelopment
The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size.
Examples 3495
{method} {target} CLIENT: http.client (opt-in){method} {target} SERVER: http.server (opt-in)http.request.header.<key>string[]Stable
HTTP request headers, <key> being the normalized HTTP Header name (lowercase), the value being the header values.
Examples ["application/json"], ["1.2.3.4","1.2.3.5"]
{method} {target} CLIENT: http.client (opt-in){method} {target} SERVER: http.server (opt-in)http.request.methodstringStable
HTTP request method.
Values CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE, QUERY, _OTHER
{method} {target} CLIENT: http.client (required){method} {target} SERVER: http.server (required)http.request.method_originalstringStable
Original HTTP method sent by the client in the request line.
Examples GeT, ACL, foo
{method} {target} CLIENT: http.client (conditionally required){method} {target} SERVER: http.server (conditionally required)http.request.resend_countintStable
The ordinal number of request resending attempt (for any reason, including redirects).
Examples 3
{method} {target} CLIENT: http.client (recommended)http.request.sizeintDevelopment
The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any.
Examples 1437
{method} {target} CLIENT: http.client (opt-in){method} {target} SERVER: http.server (opt-in)http.response.body.sizeintDevelopment
The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size.
Examples 3495
{method} {target} CLIENT: http.client (opt-in){method} {target} SERVER: http.server (opt-in)http.response.header.<key>string[]Stable
HTTP response headers, <key> being the normalized HTTP Header name (lowercase), the value being the header values.
Examples ["application/json"], ["abc","def"]
{method} {target} CLIENT: http.client (opt-in){method} {target} SERVER: http.server (opt-in)http.response.sizeintDevelopment
The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any.
Examples 1437
{method} {target} CLIENT: http.client (opt-in){method} {target} SERVER: http.server (opt-in)http.response.status_codeintStable
HTTP response status code.
Examples 200
{method} {target} CLIENT: http.client (conditionally required){method} {target} SERVER: http.server (conditionally required)http.routestringStable
The matched route template for the request. This MUST be low-cardinality and include all static path segments, with dynamic path segments represented with placeholders.
Examples /users/:userID?, my-controller/my-action/{id?}
{method} {target} SERVER: http.server (conditionally required)Deprecated names you may still see in older traces, each with what replaced it.
http.client_ipstringDeprecated
Renamed to client.address.
Examples 83.164.160.102
http.flavorstringDeprecated
Replaced by network.protocol.name.
Values 1.0, 1.1, 2.0, 3.0, SPDY, QUIC
http.hoststringDeprecated
Replaced by one of server.address, client.address or http.request.header.host, depending on the usage.
Examples www.example.org
http.methodstringDeprecated
Renamed to http.request.method.
Examples GET, POST, HEAD
http.request_content_lengthintDeprecated
Replaced by http.request.header.content-length.
Examples 3495
http.request_content_length_uncompressedintDeprecated
Renamed to http.request.body.size.
Examples 5493
http.response_content_lengthintDeprecated
Replaced by http.response.header.content-length.
Examples 3495
http.response_content_length_uncompressedintDeprecated
Renamed to http.response.body.size.
Examples 5493
http.schemestringDeprecated
Renamed to url.scheme.
Examples http, https
http.server_namestringDeprecated
Renamed to server.address.
Examples example.com
http.status_codeintDeprecated
Renamed to http.response.status_code.
Examples 200
http.targetstringDeprecated
Replaced by url.path.
Examples /search?q=OpenTelemetry#SemConv
http.urlstringDeprecated
Renamed to url.full.
Examples https://www.foo.bar/search?q=OpenTelemetry#SemConv
http.user_agentstringDeprecated
Renamed to user_agent.original.
Examples CERN-LineMode/2.15 libwww/2.17b3, Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1
On a client span, yes by default: a 4xx or 5xx status code SHOULD set the span status to Error. On a server span a 4xx MUST leave it unset, and only 5xx is an error. 1xx, 2xx and 3xx leave the status unset unless something else failed.
http.url became url.full. http.target was split into url.path and url.query.
Attribute names, types, stability and descriptions are from the OpenTelemetry semantic conventions (open-telemetry/semantic-conventions), © OpenTelemetry Authors, Apache-2.0. Each attribute links to its official definition, which wins where the two differ.
Something wrong or out of date? Report a problem with this page.