groups: - id: attributes.http.common type: attribute_group brief: "Describes HTTP attributes." prefix: http attributes: - id: request.method type: string requirement_level: required brief: 'HTTP request method.' examples: ["GET", "POST", "HEAD"] - id: response.status_code type: int requirement_level: conditionally_required: If and only if one was received/sent. brief: '[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).' examples: [200] - ref: network.protocol.name examples: ['http', 'spdy'] requirement_level: recommended: if not default (`http`). - ref: network.protocol.version examples: ['1.0', '1.1', '2.0'] - id: attributes.http.client prefix: http type: attribute_group brief: 'HTTP Client spans attributes' attributes: - ref: server.address requirement_level: required brief: > Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. note: | Determined by using the first of the following that applies - Host identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) if it's sent in absolute-form - Host identifier of the `Host` header SHOULD NOT be set if capturing it would require an extra DNS lookup. - ref: server.port requirement_level: conditionally_required: If not default (`80` for `http` scheme, `443` for `https`). brief: > Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. note: > When [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) is absolute URI, `server.port` MUST match URI port identifier, otherwise it MUST match `Host` header port identifier. - id: attributes.http.server prefix: http type: attribute_group brief: 'HTTP Server spans attributes' attributes: - id: route type: string requirement_level: conditionally_required: If and only if it's available brief: > The matched route (path template in the format used by the respective server framework). See note below examples: ['/users/:userID?', '{controller}/{action}/{id?}'] note: > 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](/specification/trace/semantic_conventions/http.md#http-server-definitions) if there is one. - ref: server.address requirement_level: required brief: > Name of the local HTTP server that received the request. note: | Determined by using the first of the following that applies - The [primary server name](/specification/trace/semantic_conventions/http.md#http-server-definitions) of the matched virtual host. MUST only include host identifier. - Host identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) if it's sent in absolute-form. - Host identifier of the `Host` header SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup. - ref: server.port requirement_level: conditionally_required: If not default (`80` for `http` scheme, `443` for `https`). brief: > Port of the local HTTP server that received the request. note: | Determined by using the first of the following that applies - Port identifier of the [primary server host](/specification/trace/semantic_conventions/http.md#http-server-definitions) of the matched virtual host. - Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) if it's sent in absolute-form. - Port identifier of the `Host` header - ref: url.scheme requirement_level: required examples: ["http", "https"]