From 134cdfbed708f3028f48cbc4a2b1f45b2f40201d Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 5 May 2023 12:51:21 -0700 Subject: [PATCH 01/16] Limit HTTP method values to closed set (for cardinality reason) --- semantic_conventions/http-common.yaml | 27 +- .../semantic_conventions/http-metrics.md | 280 ++++++++++++++---- .../trace/semantic_conventions/http.md | 27 +- 3 files changed, 275 insertions(+), 59 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index 32957620073..2a1791e85dc 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -5,10 +5,35 @@ groups: prefix: http attributes: - id: request.method - type: string + type: + members: + - id: connect + value: "CONNECT" + - id: delete + value: "DELETE" + - id: get + value: "GET" + - id: head + value: "HEAD" + - id: options + value: "OPTIONS" + - id: patch + value: "PATCH" + - id: post + value: "POST" + - id: put + value: "PUT" + - id: trace + value: "TRACE" + - id: other + value: "OTHER" requirement_level: required brief: 'HTTP request method.' examples: ["GET", "POST", "HEAD"] + note: > + HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. + Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. - id: response.status_code type: int requirement_level: diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 8535d5dc0a6..f3414d76ddb 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -70,20 +70,22 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | `http.route` | string | The matched route (path template in the format used by the respective server framework). See note below [1] | `/users/:userID?`; `{controller}/{action}/{id?}` | Conditionally Required: If and only if it's available | -| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | +| `http.request.method` | string | HTTP request method. [2] | `GET`; `POST`; `HEAD` | Required | | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: If and only if one was received/sent. | | [`network.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | -| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [2] | `3.1.1` | Recommended | -| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [3] | `example.com` | Required | -| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | +| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [3] | `3.1.1` | Recommended | +| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [4] | `example.com` | Required | +| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [5] | `80`; `8080`; `443` | Conditionally Required: [6] | | [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | **[1]:** 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. -**[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. -**[3]:** Determined by using the first of the following that applies +**[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + +**[4]:** 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. @@ -93,14 +95,29 @@ SHOULD include the [application root](/specification/trace/semantic_conventions/ SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup. -**[4]:** Determined by using the first of the following that applies +**[5]:** 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 -**[5]:** If not default (`80` for `http` scheme, `443` for `https`). +**[6]:** If not default (`80` for `http` scheme, `443` for `https`). + +`http.request.method` MUST be one of the following: + +| Value | Description | +|---|---| +| `CONNECT` | connect | +| `DELETE` | delete | +| `GET` | get | +| `HEAD` | head | +| `OPTIONS` | options | +| `PATCH` | patch | +| `POST` | post | +| `PUT` | put | +| `TRACE` | trace | +| `OTHER` | other | ### Metric: `http.server.active_requests` @@ -116,12 +133,14 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [1] | `example.com` | Required | -| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [2] | `80`; `8080`; `443` | Conditionally Required: [3] | +| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required | +| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [2] | `example.com` | Required | +| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | | [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | -**[1]:** Determined by using the first of the following that applies +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. + +**[2]:** 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. @@ -131,14 +150,84 @@ This metric is optional. SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup. +**[3]:** 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 + +**[4]:** If not default (`80` for `http` scheme, `443` for `https`). + +`http.request.method` MUST be one of the following: + +| Value | Description | +|---|---| +| `CONNECT` | connect | +| `DELETE` | delete | +| `GET` | get | +| `HEAD` | head | +| `OPTIONS` | options | +| `PATCH` | patch | +| `POST` | post | +| `PUT` | put | +| `TRACE` | trace | +| `OTHER` | other | + + +### Metric: `http.server.active_requests` + +This metric is optional. + + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `http.server.active_requests` | UpDownCounter | `{request}` | Measures the number of concurrent HTTP requests that are currently in-flight. | + + + +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required | +| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [2] | `example.com` | Required | +| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | +| [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | + +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. + **[2]:** 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. + +**[3]:** 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 -**[3]:** If not default (`80` for `http` scheme, `443` for `https`). +**[4]:** If not default (`80` for `http` scheme, `443` for `https`). + +`http.request.method` MUST be one of the following: + +| Value | Description | +|---|---| +| `CONNECT` | connect | +| `DELETE` | delete | +| `GET` | get | +| `HEAD` | head | +| `OPTIONS` | options | +| `PATCH` | patch | +| `POST` | post | +| `PUT` | put | +| `TRACE` | trace | +| `OTHER` | other | ### Metric: `http.server.request.size` @@ -155,20 +244,22 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | `http.route` | string | The matched route (path template in the format used by the respective server framework). See note below [1] | `/users/:userID?`; `{controller}/{action}/{id?}` | Conditionally Required: If and only if it's available | -| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | +| `http.request.method` | string | HTTP request method. [2] | `GET`; `POST`; `HEAD` | Required | | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: If and only if one was received/sent. | | [`network.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | -| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [2] | `3.1.1` | Recommended | -| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [3] | `example.com` | Required | -| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | +| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [3] | `3.1.1` | Recommended | +| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [4] | `example.com` | Required | +| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [5] | `80`; `8080`; `443` | Conditionally Required: [6] | | [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | **[1]:** 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. -**[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. -**[3]:** Determined by using the first of the following that applies +**[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + +**[4]:** 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. @@ -178,14 +269,29 @@ SHOULD include the [application root](/specification/trace/semantic_conventions/ SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup. -**[4]:** Determined by using the first of the following that applies +**[5]:** 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 -**[5]:** If not default (`80` for `http` scheme, `443` for `https`). +**[6]:** If not default (`80` for `http` scheme, `443` for `https`). + +`http.request.method` MUST be one of the following: + +| Value | Description | +|---|---| +| `CONNECT` | connect | +| `DELETE` | delete | +| `GET` | get | +| `HEAD` | head | +| `OPTIONS` | options | +| `PATCH` | patch | +| `POST` | post | +| `PUT` | put | +| `TRACE` | trace | +| `OTHER` | other | ### Metric: `http.server.response.size` @@ -202,20 +308,22 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | `http.route` | string | The matched route (path template in the format used by the respective server framework). See note below [1] | `/users/:userID?`; `{controller}/{action}/{id?}` | Conditionally Required: If and only if it's available | -| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | +| `http.request.method` | string | HTTP request method. [2] | `GET`; `POST`; `HEAD` | Required | | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: If and only if one was received/sent. | | [`network.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | -| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [2] | `3.1.1` | Recommended | -| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [3] | `example.com` | Required | -| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | +| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [3] | `3.1.1` | Recommended | +| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [4] | `example.com` | Required | +| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [5] | `80`; `8080`; `443` | Conditionally Required: [6] | | [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | **[1]:** 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. -**[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. -**[3]:** Determined by using the first of the following that applies +**[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + +**[4]:** 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. @@ -225,14 +333,29 @@ SHOULD include the [application root](/specification/trace/semantic_conventions/ SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup. -**[4]:** Determined by using the first of the following that applies +**[5]:** 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 -**[5]:** If not default (`80` for `http` scheme, `443` for `https`). +**[6]:** If not default (`80` for `http` scheme, `443` for `https`). + +`http.request.method` MUST be one of the following: + +| Value | Description | +|---|---| +| `CONNECT` | connect | +| `DELETE` | delete | +| `GET` | get | +| `HEAD` | head | +| `OPTIONS` | options | +| `PATCH` | patch | +| `POST` | post | +| `PUT` | put | +| `TRACE` | trace | +| `OTHER` | other | ## HTTP Client @@ -254,17 +377,19 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | +| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required | | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: If and only if one was received/sent. | | [`network.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | -| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [1] | `3.1.1` | Recommended | -| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [2] | `example.com` | Required | -| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | +| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [2] | `3.1.1` | Recommended | +| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [3] | `example.com` | Required | +| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. -**[2]:** Determined by using the first of the following that applies +**[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + +**[3]:** 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 @@ -272,9 +397,24 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, SHOULD NOT be set if capturing it would require an extra DNS lookup. -**[3]:** 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. +**[4]:** 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. -**[4]:** If not default (`80` for `http` scheme, `443` for `https`). +**[5]:** If not default (`80` for `http` scheme, `443` for `https`). + +`http.request.method` MUST be one of the following: + +| Value | Description | +|---|---| +| `CONNECT` | connect | +| `DELETE` | delete | +| `GET` | get | +| `HEAD` | head | +| `OPTIONS` | options | +| `PATCH` | patch | +| `POST` | post | +| `PUT` | put | +| `TRACE` | trace | +| `OTHER` | other | ### Metric: `http.client.request.size` @@ -290,17 +430,19 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | +| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required | | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: If and only if one was received/sent. | | [`network.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | -| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [1] | `3.1.1` | Recommended | -| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [2] | `example.com` | Required | -| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | +| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [2] | `3.1.1` | Recommended | +| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [3] | `example.com` | Required | +| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. -**[2]:** Determined by using the first of the following that applies +**[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + +**[3]:** 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 @@ -308,9 +450,24 @@ This metric is optional. SHOULD NOT be set if capturing it would require an extra DNS lookup. -**[3]:** 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. +**[4]:** 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. -**[4]:** If not default (`80` for `http` scheme, `443` for `https`). +**[5]:** If not default (`80` for `http` scheme, `443` for `https`). + +`http.request.method` MUST be one of the following: + +| Value | Description | +|---|---| +| `CONNECT` | connect | +| `DELETE` | delete | +| `GET` | get | +| `HEAD` | head | +| `OPTIONS` | options | +| `PATCH` | patch | +| `POST` | post | +| `PUT` | put | +| `TRACE` | trace | +| `OTHER` | other | ### Metric: `http.client.response.size` @@ -326,17 +483,19 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | +| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required | | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: If and only if one was received/sent. | | [`network.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | -| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [1] | `3.1.1` | Recommended | -| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [2] | `example.com` | Required | -| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | +| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [2] | `3.1.1` | Recommended | +| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [3] | `example.com` | Required | +| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. -**[2]:** Determined by using the first of the following that applies +**[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + +**[3]:** 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 @@ -344,7 +503,22 @@ This metric is optional. SHOULD NOT be set if capturing it would require an extra DNS lookup. -**[3]:** 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. +**[4]:** 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. -**[4]:** If not default (`80` for `http` scheme, `443` for `https`). +**[5]:** If not default (`80` for `http` scheme, `443` for `https`). + +`http.request.method` MUST be one of the following: + +| Value | Description | +|---|---| +| `CONNECT` | connect | +| `DELETE` | delete | +| `GET` | get | +| `HEAD` | head | +| `OPTIONS` | options | +| `PATCH` | patch | +| `POST` | post | +| `PUT` | put | +| `TRACE` | trace | +| `OTHER` | other | diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index eea84660c21..20e39aa922a 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -92,21 +92,38 @@ sections below. | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: If and only if one was received/sent. | | `http.request.body.size` | int | 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](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. | `3495` | Recommended | | `http.response.body.size` | int | 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](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. | `3495` | Recommended | -| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | +| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required | | [`network.protocol.name`](span-general.md) | string | [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `http`; `spdy` | Recommended: if not default (`http`). | -| [`network.protocol.version`](span-general.md) | string | Version of the application layer protocol used. See note below. [1] | `1.0`; `1.1`; `2.0` | Recommended | -| [`network.transport`](span-general.md) | string | [OSI Transport Layer](https://osi-model.com/transport-layer/) or [Inter-process Communication method](https://en.wikipedia.org/wiki/Inter-process_communication). The value SHOULD be normalized to lowercase. | `tcp`; `udp` | Conditionally Required: [2] | +| [`network.protocol.version`](span-general.md) | string | Version of the application layer protocol used. See note below. [2] | `1.0`; `1.1`; `2.0` | Recommended | +| [`network.transport`](span-general.md) | string | [OSI Transport Layer](https://osi-model.com/transport-layer/) or [Inter-process Communication method](https://en.wikipedia.org/wiki/Inter-process_communication). The value SHOULD be normalized to lowercase. | `tcp`; `udp` | Conditionally Required: [3] | | [`network.type`](span-general.md) | string | [OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `ipv4`; `ipv6` | Recommended | | `user_agent.original` | string | Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | -**[1]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. -**[2]:** If not default (`tcp` for `HTTP/1.1` and `HTTP/2`, `udp` for `HTTP/3`). +**[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + +**[3]:** If not default (`tcp` for `HTTP/1.1` and `HTTP/2`, `udp` for `HTTP/3`). Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions: * `http.request.method` +`http.request.method` MUST be one of the following: + +| Value | Description | +|---|---| +| `CONNECT` | connect | +| `DELETE` | delete | +| `GET` | get | +| `HEAD` | head | +| `OPTIONS` | options | +| `PATCH` | patch | +| `POST` | post | +| `PUT` | put | +| `TRACE` | trace | +| `OTHER` | other | + `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | Value | Description | From a4e5f6b56be2d1a91800cf14229a829ddf4b95f4 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 5 May 2023 12:55:51 -0700 Subject: [PATCH 02/16] nits --- semantic_conventions/http-common.yaml | 6 +++--- .../metrics/semantic_conventions/http-metrics.md | 14 +++++++------- specification/trace/semantic_conventions/http.md | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index 2a1791e85dc..0aec8176106 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -32,9 +32,9 @@ groups: examples: ["GET", "POST", "HEAD"] note: > HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. - Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. - - id: response.status_code + Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. + Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. + - id: status_code type: int requirement_level: conditionally_required: If and only if one was received/sent. diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index f3414d76ddb..b79d7971ca3 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -81,7 +81,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -193,7 +193,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | | [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** Determined by using the first of the following that applies @@ -255,7 +255,7 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -319,7 +319,7 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -385,7 +385,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -438,7 +438,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -491,7 +491,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 20e39aa922a..6891f746427 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -99,7 +99,7 @@ sections below. | [`network.type`](span-general.md) | string | [OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `ipv4`; `ipv6` | Recommended | | `user_agent.original` | string | Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. From ce9619eee34a25da28a078514ae51fd554ab51aa Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 5 May 2023 13:02:03 -0700 Subject: [PATCH 03/16] lint --- semantic_conventions/http-common.yaml | 14 ++++++++------ .../metrics/semantic_conventions/http-metrics.md | 14 +++++++------- specification/trace/semantic_conventions/http.md | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index 0aec8176106..ef3e892d3f3 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -10,7 +10,7 @@ groups: - id: connect value: "CONNECT" - id: delete - value: "DELETE" + value: "DELETE" - id: get value: "GET" - id: head @@ -18,11 +18,11 @@ groups: - id: options value: "OPTIONS" - id: patch - value: "PATCH" + value: "PATCH" - id: post - value: "POST" + value: "POST" - id: put - value: "PUT" + value: "PUT" - id: trace value: "TRACE" - id: other @@ -31,8 +31,10 @@ groups: brief: 'HTTP request method.' examples: ["GET", "POST", "HEAD"] note: > - HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. + HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) + or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + Instrumentation MAY additionally support a closet set of custom HTTP methods defined in + [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. - id: status_code type: int diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index b79d7971ca3..63d58a29804 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -81,7 +81,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -193,7 +193,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | | [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** Determined by using the first of the following that applies @@ -255,7 +255,7 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -319,7 +319,7 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -385,7 +385,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -438,7 +438,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -491,7 +491,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 6891f746427..77c24e70b0e 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -99,7 +99,7 @@ sections below. | [`network.type`](span-general.md) | string | [OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `ipv4`; `ipv6` | Recommended | | `user_agent.original` | string | Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. From aefbe69b6277465d91ea0c0734a6d842d1e6905f Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 5 May 2023 13:08:16 -0700 Subject: [PATCH 04/16] add briefs --- semantic_conventions/http-common.yaml | 12 +- .../semantic_conventions/http-metrics.md | 140 +++++++++--------- .../trace/semantic_conventions/http.md | 20 +-- 3 files changed, 91 insertions(+), 81 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index ef3e892d3f3..e628ee23ba5 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -9,24 +9,34 @@ groups: members: - id: connect value: "CONNECT" + brief: 'CONNECT method.' - id: delete value: "DELETE" + brief: 'DELETE method.' - id: get value: "GET" + brief: 'GET method.' - id: head value: "HEAD" + brief: 'HEAD method.' - id: options value: "OPTIONS" + brief: 'OPTIONS method.' - id: patch - value: "PATCH" + value: "PATCH" + brief: 'PATCH method.' - id: post value: "POST" + brief: 'POST method.' - id: put value: "PUT" + brief: 'PUT method.' - id: trace value: "TRACE" + brief: 'TRACE method.' - id: other value: "OTHER" + brief: 'Any custom HTTP method instrumentation has not prior knowledge of.' requirement_level: required brief: 'HTTP request method.' examples: ["GET", "POST", "HEAD"] diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 63d58a29804..322b785e8b8 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -108,16 +108,16 @@ SHOULD NOT be set if only IP address is available and capturing name would requi | Value | Description | |---|---| -| `CONNECT` | connect | -| `DELETE` | delete | -| `GET` | get | -| `HEAD` | head | -| `OPTIONS` | options | -| `PATCH` | patch | -| `POST` | post | -| `PUT` | put | -| `TRACE` | trace | -| `OTHER` | other | +| `CONNECT` | CONNECT method. | +| `DELETE` | DELETE method. | +| `GET` | GET method. | +| `HEAD` | HEAD method. | +| `OPTIONS` | OPTIONS method. | +| `PATCH` | PATCH method. | +| `POST` | POST method. | +| `PUT` | PUT method. | +| `TRACE` | TRACE method. | +| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | ### Metric: `http.server.active_requests` @@ -218,16 +218,16 @@ SHOULD NOT be set if only IP address is available and capturing name would requi | Value | Description | |---|---| -| `CONNECT` | connect | -| `DELETE` | delete | -| `GET` | get | -| `HEAD` | head | -| `OPTIONS` | options | -| `PATCH` | patch | -| `POST` | post | -| `PUT` | put | -| `TRACE` | trace | -| `OTHER` | other | +| `CONNECT` | CONNECT method. | +| `DELETE` | DELETE method. | +| `GET` | GET method. | +| `HEAD` | HEAD method. | +| `OPTIONS` | OPTIONS method. | +| `PATCH` | PATCH method. | +| `POST` | POST method. | +| `PUT` | PUT method. | +| `TRACE` | TRACE method. | +| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | ### Metric: `http.server.request.size` @@ -282,16 +282,16 @@ SHOULD NOT be set if only IP address is available and capturing name would requi | Value | Description | |---|---| -| `CONNECT` | connect | -| `DELETE` | delete | -| `GET` | get | -| `HEAD` | head | -| `OPTIONS` | options | -| `PATCH` | patch | -| `POST` | post | -| `PUT` | put | -| `TRACE` | trace | -| `OTHER` | other | +| `CONNECT` | CONNECT method. | +| `DELETE` | DELETE method. | +| `GET` | GET method. | +| `HEAD` | HEAD method. | +| `OPTIONS` | OPTIONS method. | +| `PATCH` | PATCH method. | +| `POST` | POST method. | +| `PUT` | PUT method. | +| `TRACE` | TRACE method. | +| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | ### Metric: `http.server.response.size` @@ -346,16 +346,16 @@ SHOULD NOT be set if only IP address is available and capturing name would requi | Value | Description | |---|---| -| `CONNECT` | connect | -| `DELETE` | delete | -| `GET` | get | -| `HEAD` | head | -| `OPTIONS` | options | -| `PATCH` | patch | -| `POST` | post | -| `PUT` | put | -| `TRACE` | trace | -| `OTHER` | other | +| `CONNECT` | CONNECT method. | +| `DELETE` | DELETE method. | +| `GET` | GET method. | +| `HEAD` | HEAD method. | +| `OPTIONS` | OPTIONS method. | +| `PATCH` | PATCH method. | +| `POST` | POST method. | +| `PUT` | PUT method. | +| `TRACE` | TRACE method. | +| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | ## HTTP Client @@ -405,16 +405,16 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. | Value | Description | |---|---| -| `CONNECT` | connect | -| `DELETE` | delete | -| `GET` | get | -| `HEAD` | head | -| `OPTIONS` | options | -| `PATCH` | patch | -| `POST` | post | -| `PUT` | put | -| `TRACE` | trace | -| `OTHER` | other | +| `CONNECT` | CONNECT method. | +| `DELETE` | DELETE method. | +| `GET` | GET method. | +| `HEAD` | HEAD method. | +| `OPTIONS` | OPTIONS method. | +| `PATCH` | PATCH method. | +| `POST` | POST method. | +| `PUT` | PUT method. | +| `TRACE` | TRACE method. | +| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | ### Metric: `http.client.request.size` @@ -458,16 +458,16 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. | Value | Description | |---|---| -| `CONNECT` | connect | -| `DELETE` | delete | -| `GET` | get | -| `HEAD` | head | -| `OPTIONS` | options | -| `PATCH` | patch | -| `POST` | post | -| `PUT` | put | -| `TRACE` | trace | -| `OTHER` | other | +| `CONNECT` | CONNECT method. | +| `DELETE` | DELETE method. | +| `GET` | GET method. | +| `HEAD` | HEAD method. | +| `OPTIONS` | OPTIONS method. | +| `PATCH` | PATCH method. | +| `POST` | POST method. | +| `PUT` | PUT method. | +| `TRACE` | TRACE method. | +| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | ### Metric: `http.client.response.size` @@ -511,14 +511,14 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. | Value | Description | |---|---| -| `CONNECT` | connect | -| `DELETE` | delete | -| `GET` | get | -| `HEAD` | head | -| `OPTIONS` | options | -| `PATCH` | patch | -| `POST` | post | -| `PUT` | put | -| `TRACE` | trace | -| `OTHER` | other | +| `CONNECT` | CONNECT method. | +| `DELETE` | DELETE method. | +| `GET` | GET method. | +| `HEAD` | HEAD method. | +| `OPTIONS` | OPTIONS method. | +| `PATCH` | PATCH method. | +| `POST` | POST method. | +| `PUT` | PUT method. | +| `TRACE` | TRACE method. | +| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 77c24e70b0e..e57a561b0ee 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -113,16 +113,16 @@ Following attributes MUST be provided **at span creation time** (when provided a | Value | Description | |---|---| -| `CONNECT` | connect | -| `DELETE` | delete | -| `GET` | get | -| `HEAD` | head | -| `OPTIONS` | options | -| `PATCH` | patch | -| `POST` | post | -| `PUT` | put | -| `TRACE` | trace | -| `OTHER` | other | +| `CONNECT` | CONNECT method. | +| `DELETE` | DELETE method. | +| `GET` | GET method. | +| `HEAD` | HEAD method. | +| `OPTIONS` | OPTIONS method. | +| `PATCH` | PATCH method. | +| `POST` | POST method. | +| `PUT` | PUT method. | +| `TRACE` | TRACE method. | +| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. From 38a470c04071f548cc7f676bd03bf6f947992312 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 5 May 2023 13:10:15 -0700 Subject: [PATCH 05/16] remove mentions of custom registry --- semantic_conventions/http-common.yaml | 2 -- .../metrics/semantic_conventions/http-metrics.md | 14 +++++++------- specification/trace/semantic_conventions/http.md | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index e628ee23ba5..c07e2ccd807 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -43,8 +43,6 @@ groups: note: > HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - Instrumentation MAY additionally support a closet set of custom HTTP methods defined in - [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. - id: status_code type: int diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 322b785e8b8..596dd227ffe 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -81,7 +81,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -193,7 +193,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | | [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** Determined by using the first of the following that applies @@ -255,7 +255,7 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -319,7 +319,7 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -385,7 +385,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -438,7 +438,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -491,7 +491,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index e57a561b0ee..f68b1c17ec9 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -99,7 +99,7 @@ sections below. | [`network.type`](span-general.md) | string | [OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `ipv4`; `ipv6` | Recommended | | `user_agent.original` | string | Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closet set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. From afda12f2bf7c205ab68c1b5009953cc3f6e51999 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 5 May 2023 13:14:02 -0700 Subject: [PATCH 06/16] address comments --- semantic_conventions/http-common.yaml | 10 ++++--- .../semantic_conventions/http-metrics.md | 28 +++++++++---------- .../trace/semantic_conventions/http.md | 4 +-- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index c07e2ccd807..d2fb36e319d 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -36,14 +36,16 @@ groups: brief: 'TRACE method.' - id: other value: "OTHER" - brief: 'Any custom HTTP method instrumentation has not prior knowledge of.' + brief: 'Any custom HTTP method that the instrumentation has no prior knowledge of.' requirement_level: required brief: 'HTTP request method.' examples: ["GET", "POST", "HEAD"] note: > - HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) - or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. + HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) + or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + Instrumentation MAY additionally support a closed set of custom HTTP methods defined in + [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. + Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - id: status_code type: int requirement_level: diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 596dd227ffe..eadd1058091 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -81,7 +81,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -117,7 +117,7 @@ SHOULD NOT be set if only IP address is available and capturing name would requi | `POST` | POST method. | | `PUT` | PUT method. | | `TRACE` | TRACE method. | -| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | +| `OTHER` | Any custom HTTP method that the instrumentation has no prior knowledge of. | ### Metric: `http.server.active_requests` @@ -193,7 +193,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | | [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[2]:** Determined by using the first of the following that applies @@ -227,7 +227,7 @@ SHOULD NOT be set if only IP address is available and capturing name would requi | `POST` | POST method. | | `PUT` | PUT method. | | `TRACE` | TRACE method. | -| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | +| `OTHER` | Any custom HTTP method that the instrumentation has no prior knowledge of. | ### Metric: `http.server.request.size` @@ -255,7 +255,7 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -291,7 +291,7 @@ SHOULD NOT be set if only IP address is available and capturing name would requi | `POST` | POST method. | | `PUT` | PUT method. | | `TRACE` | TRACE method. | -| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | +| `OTHER` | Any custom HTTP method that the instrumentation has no prior knowledge of. | ### Metric: `http.server.response.size` @@ -319,7 +319,7 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -355,7 +355,7 @@ SHOULD NOT be set if only IP address is available and capturing name would requi | `POST` | POST method. | | `PUT` | PUT method. | | `TRACE` | TRACE method. | -| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | +| `OTHER` | Any custom HTTP method that the instrumentation has no prior knowledge of. | ## HTTP Client @@ -385,7 +385,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -414,7 +414,7 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. | `POST` | POST method. | | `PUT` | PUT method. | | `TRACE` | TRACE method. | -| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | +| `OTHER` | Any custom HTTP method that the instrumentation has no prior knowledge of. | ### Metric: `http.client.request.size` @@ -438,7 +438,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -467,7 +467,7 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. | `POST` | POST method. | | `PUT` | PUT method. | | `TRACE` | TRACE method. | -| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | +| `OTHER` | Any custom HTTP method that the instrumentation has no prior knowledge of. | ### Metric: `http.client.response.size` @@ -491,7 +491,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -520,5 +520,5 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. | `POST` | POST method. | | `PUT` | PUT method. | | `TRACE` | TRACE method. | -| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | +| `OTHER` | Any custom HTTP method that the instrumentation has no prior knowledge of. | diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index f68b1c17ec9..ce258bdf73e 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -99,7 +99,7 @@ sections below. | [`network.type`](span-general.md) | string | [OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `ipv4`; `ipv6` | Recommended | | `user_agent.original` | string | Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to this instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -122,7 +122,7 @@ Following attributes MUST be provided **at span creation time** (when provided a | `POST` | POST method. | | `PUT` | PUT method. | | `TRACE` | TRACE method. | -| `OTHER` | Any custom HTTP method instrumentation has not prior knowledge of. | +| `OTHER` | Any custom HTTP method that the instrumentation has no prior knowledge of. | `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. From 936957a90a66be1eb1e74e6fe7338d0fc9983809 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 5 May 2023 13:18:10 -0700 Subject: [PATCH 07/16] more comments --- semantic_conventions/http-common.yaml | 2 +- .../metrics/semantic_conventions/http-metrics.md | 14 +++++++------- specification/trace/semantic_conventions/http.md | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index d2fb36e319d..310c46f61a2 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -43,7 +43,7 @@ groups: note: > HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - Instrumentation MAY additionally support a closed set of custom HTTP methods defined in + Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - id: status_code diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index eadd1058091..1d5d4deb429 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -81,7 +81,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, **[1]:** 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. -**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -193,7 +193,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | | [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[2]:** Determined by using the first of the following that applies @@ -255,7 +255,7 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -319,7 +319,7 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -385,7 +385,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -438,7 +438,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -491,7 +491,7 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index ce258bdf73e..782cc491f0c 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -99,7 +99,7 @@ sections below. | [`network.type`](span-general.md) | string | [OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `ipv4`; `ipv6` | Recommended | | `user_agent.original` | string | Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. From c2892d73f90fbbbdf3e68d0c68eb40723784c909 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 5 May 2023 13:35:37 -0700 Subject: [PATCH 08/16] changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb87e881292..7cf8a89b0f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,7 +87,9 @@ release. `http.scheme` to `url.scheme`, and removes `http.target` breaking it down to `http.target` to `url.path`, `url.query`, and `url.fragment`. ([#3355](https://github.com/open-telemetry/opentelemetry-specification/pull/3355)) - +- BREAKING: Limit `http.method` values to a closed set of known values + ([#3478](https://github.com/open-telemetry/opentelemetry-specification/pull/3478)) + ### Compatibility ### Supplemenatary Guidelines From af64e22d4a2d81fb7a31e9b281858c4f7d089041 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 5 May 2023 14:08:50 -0700 Subject: [PATCH 09/16] allow custom values --- semantic_conventions/http-common.yaml | 1 + .../semantic_conventions/http-metrics.md | 28 +++++++++++++++++++ .../trace/semantic_conventions/http.md | 4 +++ 3 files changed, 33 insertions(+) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index 310c46f61a2..7e85bd2a3f9 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -6,6 +6,7 @@ groups: attributes: - id: request.method type: + allow_custom_values: true members: - id: connect value: "CONNECT" diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 1d5d4deb429..d910836b931 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -104,7 +104,11 @@ SHOULD NOT be set if only IP address is available and capturing name would requi **[6]:** If not default (`80` for `http` scheme, `443` for `https`). +<<<<<<< HEAD `http.request.method` MUST be one of the following: +======= +`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +>>>>>>> 4b65b19 (allow custom values) | Value | Description | |---|---| @@ -214,7 +218,11 @@ SHOULD NOT be set if only IP address is available and capturing name would requi **[4]:** If not default (`80` for `http` scheme, `443` for `https`). +<<<<<<< HEAD `http.request.method` MUST be one of the following: +======= +`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +>>>>>>> 4b65b19 (allow custom values) | Value | Description | |---|---| @@ -278,7 +286,11 @@ SHOULD NOT be set if only IP address is available and capturing name would requi **[6]:** If not default (`80` for `http` scheme, `443` for `https`). +<<<<<<< HEAD `http.request.method` MUST be one of the following: +======= +`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +>>>>>>> 4b65b19 (allow custom values) | Value | Description | |---|---| @@ -342,7 +354,11 @@ SHOULD NOT be set if only IP address is available and capturing name would requi **[6]:** If not default (`80` for `http` scheme, `443` for `https`). +<<<<<<< HEAD `http.request.method` MUST be one of the following: +======= +`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +>>>>>>> 4b65b19 (allow custom values) | Value | Description | |---|---| @@ -401,7 +417,11 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. **[5]:** If not default (`80` for `http` scheme, `443` for `https`). +<<<<<<< HEAD `http.request.method` MUST be one of the following: +======= +`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +>>>>>>> 4b65b19 (allow custom values) | Value | Description | |---|---| @@ -454,7 +474,11 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. **[5]:** If not default (`80` for `http` scheme, `443` for `https`). +<<<<<<< HEAD `http.request.method` MUST be one of the following: +======= +`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +>>>>>>> 4b65b19 (allow custom values) | Value | Description | |---|---| @@ -507,7 +531,11 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. **[5]:** If not default (`80` for `http` scheme, `443` for `https`). +<<<<<<< HEAD `http.request.method` MUST be one of the following: +======= +`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +>>>>>>> 4b65b19 (allow custom values) | Value | Description | |---|---| diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 782cc491f0c..20dc3625069 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -109,7 +109,11 @@ Following attributes MUST be provided **at span creation time** (when provided a * `http.request.method` +<<<<<<< HEAD `http.request.method` MUST be one of the following: +======= +`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +>>>>>>> 4b65b19 (allow custom values) | Value | Description | |---|---| From fb1d6779631320260c20d3c700e05d51ae8b98cd Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Mon, 8 May 2023 13:01:23 -0700 Subject: [PATCH 10/16] add note on method case-sensitivity --- semantic_conventions/http-common.yaml | 6 +- .../semantic_conventions/http-metrics.md | 128 ++++++++++-------- .../trace/semantic_conventions/http.md | 14 +- 3 files changed, 86 insertions(+), 62 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index 7e85bd2a3f9..4c435346423 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -41,13 +41,15 @@ groups: requirement_level: required brief: 'HTTP request method.' examples: ["GET", "POST", "HEAD"] - note: > + note: | HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - - id: status_code + + HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. + - id: response.status_code type: int requirement_level: conditionally_required: If and only if one was received/sent. diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index d910836b931..97eed6996a3 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -81,7 +81,13 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, **[1]:** 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. -**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). +Instrumentation MAY additionally support the closed set of custom HTTP methods defined in +[HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. +Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. + +HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -104,11 +110,7 @@ SHOULD NOT be set if only IP address is available and capturing name would requi **[6]:** If not default (`80` for `http` scheme, `443` for `https`). -<<<<<<< HEAD -`http.request.method` MUST be one of the following: -======= -`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. ->>>>>>> 4b65b19 (allow custom values) +`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | Value | Description | |---|---| @@ -142,7 +144,13 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | | [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | -**[1]:** HTTP request method SHOULD match one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or a PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentations MAY support a closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or another registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not listed in the supported HTTP method set. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). +Instrumentation MAY additionally support the closed set of custom HTTP methods defined in +[HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. +Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. + +HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** Determined by using the first of the following that applies @@ -163,20 +171,20 @@ SHOULD NOT be set if only IP address is available and capturing name would requi **[4]:** If not default (`80` for `http` scheme, `443` for `https`). -`http.request.method` MUST be one of the following: +`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | Value | Description | |---|---| -| `CONNECT` | connect | -| `DELETE` | delete | -| `GET` | get | -| `HEAD` | head | -| `OPTIONS` | options | -| `PATCH` | patch | -| `POST` | post | -| `PUT` | put | -| `TRACE` | trace | -| `OTHER` | other | +| `CONNECT` | CONNECT method. | +| `DELETE` | DELETE method. | +| `GET` | GET method. | +| `HEAD` | HEAD method. | +| `OPTIONS` | OPTIONS method. | +| `PATCH` | PATCH method. | +| `POST` | POST method. | +| `PUT` | PUT method. | +| `TRACE` | TRACE method. | +| `OTHER` | Any custom HTTP method that the instrumentation has no prior knowledge of. | ### Metric: `http.server.active_requests` @@ -197,7 +205,13 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | | [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). +Instrumentation MAY additionally support the closed set of custom HTTP methods defined in +[HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. +Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. + +HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** Determined by using the first of the following that applies @@ -218,11 +232,7 @@ SHOULD NOT be set if only IP address is available and capturing name would requi **[4]:** If not default (`80` for `http` scheme, `443` for `https`). -<<<<<<< HEAD -`http.request.method` MUST be one of the following: -======= -`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. ->>>>>>> 4b65b19 (allow custom values) +`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | Value | Description | |---|---| @@ -263,7 +273,13 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). +Instrumentation MAY additionally support the closed set of custom HTTP methods defined in +[HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. +Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. + +HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -286,11 +302,7 @@ SHOULD NOT be set if only IP address is available and capturing name would requi **[6]:** If not default (`80` for `http` scheme, `443` for `https`). -<<<<<<< HEAD -`http.request.method` MUST be one of the following: -======= -`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. ->>>>>>> 4b65b19 (allow custom values) +`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | Value | Description | |---|---| @@ -331,7 +343,13 @@ This metric is optional. **[1]:** 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. -**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). +Instrumentation MAY additionally support the closed set of custom HTTP methods defined in +[HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. +Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. + +HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -354,11 +372,7 @@ SHOULD NOT be set if only IP address is available and capturing name would requi **[6]:** If not default (`80` for `http` scheme, `443` for `https`). -<<<<<<< HEAD -`http.request.method` MUST be one of the following: -======= -`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. ->>>>>>> 4b65b19 (allow custom values) +`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | Value | Description | |---|---| @@ -401,7 +415,13 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). +Instrumentation MAY additionally support the closed set of custom HTTP methods defined in +[HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. +Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. + +HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -417,11 +437,7 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. **[5]:** If not default (`80` for `http` scheme, `443` for `https`). -<<<<<<< HEAD -`http.request.method` MUST be one of the following: -======= -`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. ->>>>>>> 4b65b19 (allow custom values) +`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | Value | Description | |---|---| @@ -458,7 +474,13 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). +Instrumentation MAY additionally support the closed set of custom HTTP methods defined in +[HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. +Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. + +HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -474,11 +496,7 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. **[5]:** If not default (`80` for `http` scheme, `443` for `https`). -<<<<<<< HEAD -`http.request.method` MUST be one of the following: -======= -`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. ->>>>>>> 4b65b19 (allow custom values) +`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | Value | Description | |---|---| @@ -515,7 +533,13 @@ This metric is optional. | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | | [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). +Instrumentation MAY additionally support the closed set of custom HTTP methods defined in +[HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. +Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. + +HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -531,11 +555,7 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. **[5]:** If not default (`80` for `http` scheme, `443` for `https`). -<<<<<<< HEAD -`http.request.method` MUST be one of the following: -======= -`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. ->>>>>>> 4b65b19 (allow custom values) +`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | Value | Description | |---|---| diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 20dc3625069..3d700611884 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -99,7 +99,13 @@ sections below. | [`network.type`](span-general.md) | string | [OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `ipv4`; `ipv6` | Recommended | | `user_agent.original` | string | Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). +Instrumentation MAY additionally support the closed set of custom HTTP methods defined in +[HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. +Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. + +HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -109,11 +115,7 @@ Following attributes MUST be provided **at span creation time** (when provided a * `http.request.method` -<<<<<<< HEAD -`http.request.method` MUST be one of the following: -======= -`http.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. ->>>>>>> 4b65b19 (allow custom values) +`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | Value | Description | |---|---| From 5d5356e765503064c2f26265484a21e51399696e Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Mon, 8 May 2023 16:31:39 -0700 Subject: [PATCH 11/16] do not normalize --- semantic_conventions/http-common.yaml | 1 - .../metrics/semantic_conventions/http-metrics.md | 8 -------- specification/trace/semantic_conventions/http.md | 1 - 3 files changed, 10 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index 4c435346423..f81d0d4730e 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -47,7 +47,6 @@ groups: Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. - id: response.status_code type: int diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 97eed6996a3..4385cd4c17d 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -86,7 +86,6 @@ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789. Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -149,7 +148,6 @@ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789. Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** Determined by using the first of the following that applies @@ -210,7 +208,6 @@ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789. Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** Determined by using the first of the following that applies @@ -278,7 +275,6 @@ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789. Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -348,7 +344,6 @@ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789. Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -420,7 +415,6 @@ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789. Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -479,7 +473,6 @@ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789. Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -538,7 +531,6 @@ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789. Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 3d700611884..51da13c373a 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -104,7 +104,6 @@ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789. Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. - HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. From 0d2e2694e71979e6b01df4971326f9d4cf67cc79 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Tue, 9 May 2023 11:47:54 -0700 Subject: [PATCH 12/16] propose http.request.original_method attribute for original method --- semantic_conventions/http-common.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index f81d0d4730e..eea61816cbe 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -46,8 +46,16 @@ groups: or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. - Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. + If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD + populate the exact method passed by client on `http.request.original_method` attribute. + HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. + - id: request.original_method + type: string + requirement_level: + recommended: If and only if it's different than `http.request.method`. + brief: Original HTTP method sent by the client in the request line. + examples: ["GeT", "ACL", "foo"] - id: response.status_code type: int requirement_level: From 1c23a0eb9368d18f9db9b91670faa1b23d55e79d Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Tue, 9 May 2023 11:49:33 -0700 Subject: [PATCH 13/16] up --- .../semantic_conventions/http-metrics.md | 32 ++++++++++++++----- .../trace/semantic_conventions/http.md | 19 +++++++---- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 4385cd4c17d..9d6c4a5e9d4 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -85,7 +85,9 @@ SHOULD include the [application root](/specification/trace/semantic_conventions/ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +populate the exact method passed by client on `http.request.original_method` attribute. + HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -147,7 +149,9 @@ This metric is optional. or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +populate the exact method passed by client on `http.request.original_method` attribute. + HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** Determined by using the first of the following that applies @@ -207,7 +211,9 @@ This metric is optional. or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +populate the exact method passed by client on `http.request.original_method` attribute. + HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** Determined by using the first of the following that applies @@ -274,7 +280,9 @@ SHOULD include the [application root](/specification/trace/semantic_conventions/ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +populate the exact method passed by client on `http.request.original_method` attribute. + HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -343,7 +351,9 @@ SHOULD include the [application root](/specification/trace/semantic_conventions/ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +populate the exact method passed by client on `http.request.original_method` attribute. + HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -414,7 +424,9 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +populate the exact method passed by client on `http.request.original_method` attribute. + HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -472,7 +484,9 @@ This metric is optional. or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +populate the exact method passed by client on `http.request.original_method` attribute. + HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -530,7 +544,9 @@ This metric is optional. or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +populate the exact method passed by client on `http.request.original_method` attribute. + HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 51da13c373a..5469a610eba 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -89,26 +89,31 @@ sections below. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| +| `http.request.original_method` | string | Original HTTP method sent by the client in the request line. | `GeT`; `ACL`; `foo` | Recommended: [1] | | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: If and only if one was received/sent. | | `http.request.body.size` | int | 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](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. | `3495` | Recommended | | `http.response.body.size` | int | 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](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. | `3495` | Recommended | -| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required | +| `http.request.method` | string | HTTP request method. [2] | `GET`; `POST`; `HEAD` | Required | | [`network.protocol.name`](span-general.md) | string | [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `http`; `spdy` | Recommended: if not default (`http`). | -| [`network.protocol.version`](span-general.md) | string | Version of the application layer protocol used. See note below. [2] | `1.0`; `1.1`; `2.0` | Recommended | -| [`network.transport`](span-general.md) | string | [OSI Transport Layer](https://osi-model.com/transport-layer/) or [Inter-process Communication method](https://en.wikipedia.org/wiki/Inter-process_communication). The value SHOULD be normalized to lowercase. | `tcp`; `udp` | Conditionally Required: [3] | +| [`network.protocol.version`](span-general.md) | string | Version of the application layer protocol used. See note below. [3] | `1.0`; `1.1`; `2.0` | Recommended | +| [`network.transport`](span-general.md) | string | [OSI Transport Layer](https://osi-model.com/transport-layer/) or [Inter-process Communication method](https://en.wikipedia.org/wiki/Inter-process_communication). The value SHOULD be normalized to lowercase. | `tcp`; `udp` | Conditionally Required: [4] | | [`network.type`](span-general.md) | string | [OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `ipv4`; `ipv6` | Recommended | | `user_agent.original` | string | Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +**[1]:** If and only if it's different than `http.request.method`. + +**[2]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -Instrumentation MUST set the `http.method` attribute to `OTHER` if the HTTP request method is not known to the instrumentation. +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +populate the exact method passed by client on `http.request.original_method` attribute. + HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. -**[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +**[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. -**[3]:** If not default (`tcp` for `HTTP/1.1` and `HTTP/2`, `udp` for `HTTP/3`). +**[4]:** If not default (`tcp` for `HTTP/1.1` and `HTTP/2`, `udp` for `HTTP/3`). Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions: From c69b1269feb0626f0ff6ece4d7e088e3ce575963 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 10 May 2023 14:14:55 -0700 Subject: [PATCH 14/16] lint and nits --- CHANGELOG.md | 2 +- semantic_conventions/http-common.yaml | 6 +++--- .../metrics/semantic_conventions/http-metrics.md | 16 ++++++++-------- specification/trace/semantic_conventions/http.md | 6 +++--- .../instrumentation/aws-lambda.md | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cf8a89b0f4..99ef8fdccba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,7 +87,7 @@ release. `http.scheme` to `url.scheme`, and removes `http.target` breaking it down to `http.target` to `url.path`, `url.query`, and `url.fragment`. ([#3355](https://github.com/open-telemetry/opentelemetry-specification/pull/3355)) -- BREAKING: Limit `http.method` values to a closed set of known values +- BREAKING: Limit `http.request.method` values to a closed set of known values ([#3478](https://github.com/open-telemetry/opentelemetry-specification/pull/3478)) ### Compatibility diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index eea61816cbe..06dcb03a457 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -46,16 +46,16 @@ groups: or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. - If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD + If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. - HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. + HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. - id: request.original_method type: string requirement_level: recommended: If and only if it's different than `http.request.method`. brief: Original HTTP method sent by the client in the request line. - examples: ["GeT", "ACL", "foo"] + examples: ["GeT", "ACL", "foo"] - id: response.status_code type: int requirement_level: diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 9d6c4a5e9d4..ebb92980214 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -88,7 +88,7 @@ Instrumentation MAY additionally support the closed set of custom HTTP methods d If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. -HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. +HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -152,7 +152,7 @@ Instrumentation MAY additionally support the closed set of custom HTTP methods d If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. -HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. +HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** Determined by using the first of the following that applies @@ -214,7 +214,7 @@ Instrumentation MAY additionally support the closed set of custom HTTP methods d If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. -HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. +HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** Determined by using the first of the following that applies @@ -283,7 +283,7 @@ Instrumentation MAY additionally support the closed set of custom HTTP methods d If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. -HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. +HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -354,7 +354,7 @@ Instrumentation MAY additionally support the closed set of custom HTTP methods d If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. -HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. +HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -427,7 +427,7 @@ Instrumentation MAY additionally support the closed set of custom HTTP methods d If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. -HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. +HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -487,7 +487,7 @@ Instrumentation MAY additionally support the closed set of custom HTTP methods d If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. -HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. +HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. @@ -547,7 +547,7 @@ Instrumentation MAY additionally support the closed set of custom HTTP methods d If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. -HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. +HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[2]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 5469a610eba..5055ade0ca3 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -56,11 +56,11 @@ and various HTTP versions like 1.1, 2 and SPDY. HTTP spans MUST follow the overall [guidelines for span names](../api.md#span). HTTP server span names SHOULD be `{http.request.method} {http.route}` if there is a (low-cardinality) `http.route` available. -HTTP server span names SHOULD be `{http.method}` if there is no (low-cardinality) +HTTP server span names SHOULD be `{http.request.method}` if there is no (low-cardinality) `http.route` available. HTTP client spans have no `http.route` attribute since client-side instrumentation is not generally aware of the "route", and therefore HTTP client spans SHOULD use -`{http.method}`. +`{http.request.method}`. Instrumentation MUST NOT default to using URI path as span name, but MAY provide hooks to allow custom logic to override the default span name. @@ -109,7 +109,7 @@ Instrumentation MAY additionally support the closed set of custom HTTP methods d If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. -HTTP method names are case-sensitive and `http.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. +HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. **[3]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. diff --git a/specification/trace/semantic_conventions/instrumentation/aws-lambda.md b/specification/trace/semantic_conventions/instrumentation/aws-lambda.md index aab4165acbf..273dff53b74 100644 --- a/specification/trace/semantic_conventions/instrumentation/aws-lambda.md +++ b/specification/trace/semantic_conventions/instrumentation/aws-lambda.md @@ -168,7 +168,7 @@ Function F: | Span Function | | `cloud.account.id` | | `12345678912` | | `server.address` | `foo.execute-api.us-east-1.amazonaws.com` | | | `server.port` | `413` | | -| `http.method` | `GET` | `GET` | +| `http.request.method` | `GET` | `GET` | | `user_agent.original` | `okhttp 3.0` | `okhttp 3.0` | | `url.scheme` | | `https` | | `url.path` | | `/pets/10` | From d027d7f3273049c0ddbda626f424f319c2d3ec13 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 10 May 2023 14:45:06 -0700 Subject: [PATCH 15/16] up --- .../metrics/semantic_conventions/http-metrics.md | 16 ++++++++-------- specification/trace/semantic_conventions/http.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index ebb92980214..fa7f671f04f 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -85,7 +85,7 @@ SHOULD include the [application root](/specification/trace/semantic_conventions/ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. @@ -149,7 +149,7 @@ This metric is optional. or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. @@ -211,7 +211,7 @@ This metric is optional. or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. @@ -280,7 +280,7 @@ SHOULD include the [application root](/specification/trace/semantic_conventions/ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. @@ -351,7 +351,7 @@ SHOULD include the [application root](/specification/trace/semantic_conventions/ or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. @@ -424,7 +424,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. @@ -484,7 +484,7 @@ This metric is optional. or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. @@ -544,7 +544,7 @@ This metric is optional. or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 5055ade0ca3..db88843e91c 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -106,7 +106,7 @@ sections below. or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). Instrumentation MAY additionally support the closed set of custom HTTP methods defined in [HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD +If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD populate the exact method passed by client on `http.request.original_method` attribute. HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. From 7b772cea03db6bf4bf7f048a025fc4c2bc78b451 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 10 May 2023 15:08:32 -0700 Subject: [PATCH 16/16] up --- .../semantic_conventions/http-metrics.md | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index fa7f671f04f..904c9853f1d 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -189,68 +189,6 @@ SHOULD NOT be set if only IP address is available and capturing name would requi | `OTHER` | Any custom HTTP method that the instrumentation has no prior knowledge of. | -### Metric: `http.server.active_requests` - -This metric is optional. - - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| `http.server.active_requests` | UpDownCounter | `{request}` | Measures the number of concurrent HTTP requests that are currently in-flight. | - - - -| Attribute | Type | Description | Examples | Requirement Level | -|---|---|---|---|---| -| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required | -| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [2] | `example.com` | Required | -| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `80`; `8080`; `443` | Conditionally Required: [4] | -| [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | - -**[1]:** HTTP request method SHOULD be one of the methods defined in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) -or the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). -Instrumentation MAY additionally support the closed set of custom HTTP methods defined in -[HTTP method registry](https://www.iana.org/assignments/http-methods/http-methods.xhtml) or a private registry. -If the HTTP request method is not known to the instrumentation, it MUST set the `http.request.method` attribute to `OTHER` and SHOULD -populate the exact method passed by client on `http.request.original_method` attribute. - -HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a standard (or documented elsewhere) HTTP method name exactly. - -**[2]:** 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. - -**[3]:** 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 - -**[4]:** If not default (`80` for `http` scheme, `443` for `https`). - -`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. - -| Value | Description | -|---|---| -| `CONNECT` | CONNECT method. | -| `DELETE` | DELETE method. | -| `GET` | GET method. | -| `HEAD` | HEAD method. | -| `OPTIONS` | OPTIONS method. | -| `PATCH` | PATCH method. | -| `POST` | POST method. | -| `PUT` | PUT method. | -| `TRACE` | TRACE method. | -| `OTHER` | Any custom HTTP method that the instrumentation has no prior knowledge of. | - - ### Metric: `http.server.request.size` This metric is optional.