Module: OpenTelemetry::SemConv::Incubating::HTTP

Defined in:
lib/opentelemetry/semconv/incubating/http/metrics.rb,
lib/opentelemetry/semconv/incubating/http/attributes.rb

Metrics Names collapse

HTTP_CLIENT_ACTIVE_REQUESTS =
Note:

Stability Level: development

Number of active HTTP requests.

'http.client.active_requests'
HTTP_CLIENT_CONNECTION_DURATION =
Note:

Stability Level: development

The duration of the successfully established outbound HTTP connections.

'http.client.connection.duration'
HTTP_CLIENT_OPEN_CONNECTIONS =
Note:

Stability Level: development

Number of outbound HTTP connections that are currently active or idle on the client.

'http.client.open_connections'
HTTP_CLIENT_REQUEST_BODY_SIZE =
Note:

Stability Level: development

Size of HTTP client request bodies.

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.

'http.client.request.body.size'
HTTP_CLIENT_REQUEST_DURATION =
Deprecated.

Now available in the stable namespace at HTTP::HTTP_CLIENT_REQUEST_DURATION.

Note:

Stability Level: stable

Duration of HTTP client requests.

'http.client.request.duration'
HTTP_CLIENT_RESPONSE_BODY_SIZE =
Note:

Stability Level: development

Size of HTTP client response bodies.

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.

'http.client.response.body.size'
HTTP_SERVER_ACTIVE_REQUESTS =
Note:

Stability Level: development

Number of active HTTP server requests.

'http.server.active_requests'
HTTP_SERVER_REQUEST_BODY_SIZE =
Note:

Stability Level: development

Size of HTTP server request bodies.

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.

'http.server.request.body.size'
HTTP_SERVER_REQUEST_DURATION =
Deprecated.

Now available in the stable namespace at HTTP::HTTP_SERVER_REQUEST_DURATION.

Note:

Stability Level: stable

Duration of HTTP server requests.

'http.server.request.duration'
HTTP_SERVER_RESPONSE_BODY_SIZE =
Note:

Stability Level: development

Size of HTTP server response bodies.

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.

'http.server.response.body.size'

Attribute Names collapse

HTTP_CLIENT_IP =
Deprecated.

“Replaced by client.address.”, “reason”: “renamed”, “renamed_to”: “client.address”

Note:

Stability Level: development

Deprecated, use client.address instead.

Examples:

Sample Values

83.164.160.102
'http.client_ip'
HTTP_CONNECTION_STATE =
Note:

Stability Level: development

State of the HTTP connection in the HTTP connection pool.

Examples:

Sample Values

active
idle
'http.connection.state'
HTTP_FLAVOR =
Deprecated.

“Replaced by network.protocol.name.”, “reason”: “renamed”, “renamed_to”: “network.protocol.name”

Note:

Stability Level: development

Deprecated, use network.protocol.name instead.

'http.flavor'
HTTP_HOST =
Deprecated.

“Replaced by one of server.address, client.address or http.request.header.host, depending on the usage.\n”, “reason”: “uncategorized”

Note:

Stability Level: development

Deprecated, use one of server.address, client.address or http.request.header.host instead, depending on the usage.

Examples:

Sample Values

www.example.org
'http.host'
HTTP_METHOD =
Deprecated.

“Replaced by http.request.method.”, “reason”: “renamed”, “renamed_to”: “http.request.method”

Note:

Stability Level: development

Deprecated, use http.request.method instead.

Examples:

Sample Values

GET
POST
HEAD
'http.method'
HTTP_REQUEST_BODY_SIZE =
Note:

Stability Level: development

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:

Sample Values

3495
'http.request.body.size'
HTTP_REQUEST_HEADER_LAMBDA =
Deprecated.

Now available in the stable namespace at HTTP::HTTP_REQUEST_HEADER_LAMBDA.

Note:

Stability Level: stable

Must be called with a key for the full attribute name. See notes below about the expectations for the state of the key.

HTTP request headers, <key> being the normalized HTTP Header name (lowercase), the value being the header values.

Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.

The User-Agent header is already captured in the user_agent.original attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended.

The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.

Examples:

  • A header Content-Type: application/json SHOULD be recorded as the http.request.header.content-type attribute with value ["application/json"].
  • A header X-Forwarded-For: 1.2.3.4, 1.2.3.5 SHOULD be recorded as the http.request.header.x-forwarded-for attribute with value ["1.2.3.4", "1.2.3.5"] or ["1.2.3.4, 1.2.3.5"] depending on the HTTP library.

Examples:

Usage

HTTP_REQUEST_HEADER_LAMBDA.call('some-cool-key') #=> 'http.request.header.some-cool-key'

Sample Values

["application/json"]
["1.2.3.4", "1.2.3.5"]
->(key) { "http.request.header.#{key}" }
HTTP_REQUEST_METHOD =
Deprecated.

Now available in the stable namespace at HTTP::HTTP_REQUEST_METHOD.

Note:

Stability Level: stable

HTTP request method.

HTTP request method value SHOULD be “known” to the instrumentation. By default, this convention defines “known” methods as the ones listed in RFC9110 and the PATCH method defined in RFC5789.

If the HTTP request method is not known to instrumentation, it MUST set the http.request.method attribute to _OTHER.

If the HTTP instrumentation could end up converting valid HTTP request methods to _OTHER, then it MUST provide a way to override the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults).

HTTP method names are case-sensitive and http.request.method attribute value MUST match a known HTTP method name exactly. Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. Tracing instrumentations that do so, MUST also set http.request.method_original to the original value.

Examples:

Sample Values

GET
POST
HEAD
'http.request.method'
HTTP_REQUEST_METHOD_ORIGINAL =
Deprecated.

Now available in the stable namespace at HTTP::HTTP_REQUEST_METHOD_ORIGINAL.

Note:

Stability Level: stable

Original HTTP method sent by the client in the request line.

Examples:

Sample Values

GeT
ACL
foo
'http.request.method_original'
HTTP_REQUEST_RESEND_COUNT =
Deprecated.

Now available in the stable namespace at HTTP::HTTP_REQUEST_RESEND_COUNT.

Note:

Stability Level: stable

The ordinal number of request resending attempt (for any reason, including redirects).

The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).

Examples:

Sample Values

3
'http.request.resend_count'
HTTP_REQUEST_SIZE =
Note:

Stability Level: development

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:

Sample Values

1437
'http.request.size'
HTTP_REQUEST_CONTENT_LENGTH =
Deprecated.

“Replaced by http.request.header.content-length.”, “reason”: “uncategorized”

Note:

Stability Level: development

Deprecated, use http.request.header.content-length instead.

Examples:

Sample Values

3495
'http.request_content_length'
HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED =
Deprecated.

“Replaced by http.request.body.size.”, “reason”: “renamed”, “renamed_to”: “http.request.body.size”

Note:

Stability Level: development

Deprecated, use http.request.body.size instead.

Examples:

Sample Values

5493
'http.request_content_length_uncompressed'
HTTP_RESPONSE_BODY_SIZE =
Note:

Stability Level: development

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:

Sample Values

3495
'http.response.body.size'
HTTP_RESPONSE_HEADER_LAMBDA =
Deprecated.

Now available in the stable namespace at HTTP::HTTP_RESPONSE_HEADER_LAMBDA.

Note:

Stability Level: stable

Must be called with a key for the full attribute name. See notes below about the expectations for the state of the key.

HTTP response headers, <key> being the normalized HTTP Header name (lowercase), the value being the header values.

Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.

Users MAY explicitly configure instrumentations to capture them even though it is not recommended.

The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.

Examples:

  • A header Content-Type: application/json header SHOULD be recorded as the http.request.response.content-type attribute with value ["application/json"].
  • A header My-custom-header: abc, def header SHOULD be recorded as the http.response.header.my-custom-header attribute with value ["abc", "def"] or ["abc, def"] depending on the HTTP library.

Examples:

Usage

HTTP_RESPONSE_HEADER_LAMBDA.call('some-cool-key') #=> 'http.response.header.some-cool-key'

Sample Values

["application/json"]
["abc", "def"]
->(key) { "http.response.header.#{key}" }
HTTP_RESPONSE_SIZE =
Note:

Stability Level: development

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:

Sample Values

1437
'http.response.size'
HTTP_RESPONSE_STATUS_CODE =
Deprecated.

Now available in the stable namespace at HTTP::HTTP_RESPONSE_STATUS_CODE.

Note:

Stability Level: stable

HTTP response status code.

Examples:

Sample Values

200
'http.response.status_code'
HTTP_RESPONSE_CONTENT_LENGTH =
Deprecated.

“Replaced by http.response.header.content-length.”, “reason”: “uncategorized”

Note:

Stability Level: development

Deprecated, use http.response.header.content-length instead.

Examples:

Sample Values

3495
'http.response_content_length'
HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED =
Deprecated.

“Replaced by http.response.body.size.”, “reason”: “renamed”, “renamed_to”: “http.response.body.size”

Note:

Stability Level: development

Deprecated, use http.response.body.size instead.

Examples:

Sample Values

5493
'http.response_content_length_uncompressed'
HTTP_ROUTE =
Deprecated.

Now available in the stable namespace at HTTP::HTTP_ROUTE.

Note:

Stability Level: stable

The matched route, that is, the path template in the format used by the respective server framework.

MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the application root if there is one.

Examples:

Sample Values

/users/:userID?
{controller}/{action}/{id?}
'http.route'
HTTP_SCHEME =
Deprecated.

“Replaced by url.scheme.”, “reason”: “renamed”, “renamed_to”: “url.scheme”

Note:

Stability Level: development

Deprecated, use url.scheme instead.

Examples:

Sample Values

http
https
'http.scheme'
HTTP_SERVER_NAME =
Deprecated.

“Replaced by server.address.”, “reason”: “renamed”, “renamed_to”: “server.address”

Note:

Stability Level: development

Deprecated, use server.address instead.

Examples:

Sample Values

example.com
'http.server_name'
HTTP_STATUS_CODE =
Deprecated.

“Replaced by http.response.status_code.”, “reason”: “renamed”, “renamed_to”: “http.response.status_code”

Note:

Stability Level: development

Deprecated, use http.response.status_code instead.

Examples:

Sample Values

200
'http.status_code'
HTTP_TARGET =
Deprecated.

“Split to url.path and url.query.”, “reason”: “obsoleted”

Note:

Stability Level: development

Deprecated, use url.path and url.query instead.

Examples:

Sample Values

/search?q=OpenTelemetry#SemConv
'http.target'
HTTP_URL =
Deprecated.

“Replaced by url.full.”, “reason”: “renamed”, “renamed_to”: “url.full”

Note:

Stability Level: development

Deprecated, use url.full instead.

Examples:

Sample Values

https://www.foo.bar/search?q=OpenTelemetry#SemConv
'http.url'
HTTP_USER_AGENT =
Deprecated.

“Replaced by user_agent.original.”, “reason”: “renamed”, “renamed_to”: “user_agent.original”

Note:

Stability Level: development

Deprecated, use user_agent.original instead.

Examples:

Sample Values

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
'http.user_agent'