From 0b11f5d40825276b64ef5cdf2c4266c5dbf78d9f Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 1 Mar 2023 17:06:08 -0800 Subject: [PATCH 01/12] Rename --- semantic_conventions/trace/general.yaml | 6 +++--- semantic_conventions/trace/messaging.yaml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/semantic_conventions/trace/general.yaml b/semantic_conventions/trace/general.yaml index 54403442946..4f8b125d2c4 100644 --- a/semantic_conventions/trace/general.yaml +++ b/semantic_conventions/trace/general.yaml @@ -28,16 +28,16 @@ groups: brief: 'Something else (non IP-based).' brief: > Transport protocol used. See note below. - - id: app.protocol.name + - id: protocol.name type: string brief: 'Application layer protocol used. The value SHOULD be normalized to lowercase.' examples: ['amqp', 'http', 'mqtt'] - - id: app.protocol.version + - id: protocol.version type: string brief: 'Version of the application layer protocol used. See note below.' examples: '3.1.1' note: > - `net.app.protocol.version` refers to the version of the protocol used and might be + `net.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`. - id: sock.peer.name diff --git a/semantic_conventions/trace/messaging.yaml b/semantic_conventions/trace/messaging.yaml index e89f6b6f944..85248724a98 100644 --- a/semantic_conventions/trace/messaging.yaml +++ b/semantic_conventions/trace/messaging.yaml @@ -171,9 +171,9 @@ groups: tag: connection-level requirement_level: recommended: If different than `net.peer.name` and if `net.sock.peer.addr` is set. - - ref: net.app.protocol.name + - ref: net.protocol.name examples: ['amqp', 'mqtt'] - - ref: net.app.protocol.version + - ref: net.protocol.version constraints: - include: network From e5b5fefdf84b39f0c6f233fe1eddba6fe373cc11 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 1 Mar 2023 17:07:49 -0800 Subject: [PATCH 02/12] make table-generation --- specification/trace/semantic_conventions/messaging.md | 10 +++++----- .../trace/semantic_conventions/span-general.md | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/specification/trace/semantic_conventions/messaging.md b/specification/trace/semantic_conventions/messaging.md index 9b23b62a3f0..e26f5703a3a 100644 --- a/specification/trace/semantic_conventions/messaging.md +++ b/specification/trace/semantic_conventions/messaging.md @@ -203,9 +203,9 @@ The following operations related to messages are defined for these semantic conv | `messaging.message.id` | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | Recommended: [5] | | `messaging.message.payload_compressed_size_bytes` | int | The compressed size of the message payload in bytes. | `2048` | Recommended: [6] | | `messaging.message.payload_size_bytes` | int | The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. | `2738` | Recommended: [7] | -| [`net.app.protocol.name`](span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `amqp`; `mqtt` | Recommended | -| [`net.app.protocol.version`](span-general.md) | string | Version of the application layer protocol used. See note below. [8] | `3.1.1` | Recommended | -| [`net.peer.name`](span-general.md) | string | Logical remote hostname, see note below. [9] | `example.com` | Conditionally Required: If available. | +| [`net.peer.name`](span-general.md) | string | Logical remote hostname, see note below. [8] | `example.com` | Conditionally Required: If available. | +| [`net.protocol.name`](span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `amqp`; `mqtt` | Recommended | +| [`net.protocol.version`](span-general.md) | string | Version of the application layer protocol used. See note below. [9] | `3.1.1` | Recommended | | [`net.sock.family`](span-general.md) | string | Protocol [address family](https://man7.org/linux/man-pages/man7/address_families.7.html) which is used for communication. | `inet6`; `bluetooth` | Conditionally Required: [10] | | [`net.sock.peer.addr`](span-general.md) | string | Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). | `127.0.0.1`; `/tmp/mysql.sock` | Recommended | | [`net.sock.peer.name`](span-general.md) | string | Remote socket peer name. | `proxy.example.com` | Recommended: [11] | @@ -225,9 +225,9 @@ The following operations related to messages are defined for these semantic conv **[7]:** Only if span represents operation on a single message. -**[8]:** `net.app.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`. +**[8]:** This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. -**[9]:** This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. +**[9]:** `net.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`. **[10]:** If different than `inet` and if any of `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers of telemetry SHOULD accept both IPv4 and IPv6 formats for the address in `net.sock.peer.addr` if `net.sock.family` is not set. This is to support instrumentations that follow previous versions of this document. diff --git a/specification/trace/semantic_conventions/span-general.md b/specification/trace/semantic_conventions/span-general.md index b0091f667b9..31928ff16f5 100644 --- a/specification/trace/semantic_conventions/span-general.md +++ b/specification/trace/semantic_conventions/span-general.md @@ -41,8 +41,8 @@ the `net.peer.*` properties of a client are equal to the `net.host.*` properties | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | `net.transport` | string | Transport protocol used. See note below. | `ip_tcp` | Recommended | -| `net.app.protocol.name` | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | -| `net.app.protocol.version` | string | Version of the application layer protocol used. See note below. [1] | `3.1.1` | Recommended | +| `net.protocol.name` | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | +| `net.protocol.version` | string | Version of the application layer protocol used. See note below. [1] | `3.1.1` | Recommended | | `net.sock.peer.name` | string | Remote socket peer name. | `proxy.example.com` | Recommended: [2] | | `net.sock.peer.addr` | string | Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). | `127.0.0.1`; `/tmp/mysql.sock` | Recommended | | `net.sock.peer.port` | int | Remote socket peer port. | `16456` | Recommended: [3] | @@ -60,7 +60,7 @@ the `net.peer.*` properties of a client are equal to the `net.host.*` properties | `net.host.carrier.mnc` | string | The mobile carrier network code. | `001` | Recommended | | `net.host.carrier.icc` | string | The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. | `DE` | Recommended | -**[1]:** `net.app.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]:** `net.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]:** If available and different from `net.peer.name` and if `net.sock.peer.addr` is set. From 93d6d812387ffc6c59b49bc36ddb336433b46232 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 1 Mar 2023 17:13:27 -0800 Subject: [PATCH 03/12] Split http.version into net.protocol.name and net.protocol.version --- semantic_conventions/http-common.yaml | 29 ++++---------------------- semantic_conventions/metrics/http.yaml | 18 ++++++++++------ 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index 8ca6b7b323d..db886cbc855 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -15,31 +15,10 @@ groups: conditionally_required: If and only if one was received/sent. brief: '[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).' examples: [200] - - id: flavor - type: - # Default value: `true`. If false, it helps the code gen tool to - # encode checks that only accept the listed values. - allow_custom_values: true - members: - - id: http_1_0 - value: '1.0' - brief: 'HTTP/1.0' - - id: http_1_1 - value: '1.1' - brief: 'HTTP/1.1' - - id: http_2_0 - value: '2.0' - brief: 'HTTP/2' - - id: http_3_0 - value: '3.0' - brief: 'HTTP/3' - - id: spdy - value: 'SPDY' - brief: 'SPDY protocol.' - - id: quic - value: 'QUIC' - brief: 'QUIC protocol.' - brief: 'Kind of HTTP protocol used.' + - ref: net.protocol.name + examples: ['spdy', 'quic', 'http'] + - ref: net.protocol.version + examples: ['1.0', '1.1', '2.0'] - id: attributes.http.client prefix: http diff --git a/semantic_conventions/metrics/http.yaml b/semantic_conventions/metrics/http.yaml index cb23f27e927..378f6846fff 100644 --- a/semantic_conventions/metrics/http.yaml +++ b/semantic_conventions/metrics/http.yaml @@ -10,7 +10,8 @@ groups: # todo (lmolkova) build tools don't populate grandparent attributes - ref: http.method - ref: http.status_code - - ref: http.flavor + - ref: net.protocol.name + - ref: net.protocol.version - id: metric.http.server.active_requests type: metric @@ -62,7 +63,8 @@ groups: # todo (lmolkova) build tools don't populate grandparent attributes - ref: http.method - ref: http.status_code - - ref: http.flavor + - ref: net.protocol.name + - ref: net.protocol.version - id: metric.http.server.response.size type: metric @@ -75,7 +77,8 @@ groups: attributes: - ref: http.method - ref: http.status_code - - ref: http.flavor + - ref: net.protocol.name + - ref: net.protocol.version - id: metric.http.client.duration type: metric @@ -87,7 +90,8 @@ groups: attributes: - ref: http.method - ref: http.status_code - - ref: http.flavor + - ref: net.protocol.name + - ref: net.protocol.version - ref: net.sock.peer.addr - id: metric.http.client.request.size @@ -101,7 +105,8 @@ groups: attributes: - ref: http.method - ref: http.status_code - - ref: http.flavor + - ref: net.protocol.name + - ref: net.protocol.version - ref: net.sock.peer.addr - id: metric.http.client.response.size @@ -115,5 +120,6 @@ groups: attributes: - ref: http.method - ref: http.status_code - - ref: http.flavor + - ref: net.protocol.name + - ref: net.protocol.version - ref: net.sock.peer.addr From c3b599d28187241d4fafd280f53a6ee1a467d559 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 1 Mar 2023 17:16:21 -0800 Subject: [PATCH 04/12] make table-generation --- .../semantic_conventions/http-metrics.md | 84 ++++--------------- .../trace/semantic_conventions/http.md | 28 +++---- 2 files changed, 28 insertions(+), 84 deletions(-) diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index e69a78b6566..6fc09f3a459 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -29,11 +29,12 @@ This metric is required. |---|---|---|---|---| | `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | Required | | `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.flavor` | string | Kind of HTTP protocol used. | `1.0` | Recommended | | `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | | `http.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. | | [`net.host.name`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [2] | `localhost` | Required | | [`net.host.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `8080` | Conditionally Required: [4] | +| [`net.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | +| [`net.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [5] | `3.1.1` | Recommended | **[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. @@ -57,16 +58,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`). -`http.flavor` 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 | -|---|---| -| `1.0` | HTTP/1.0 | -| `1.1` | HTTP/1.1 | -| `2.0` | HTTP/2 | -| `3.0` | HTTP/3 | -| `SPDY` | SPDY protocol. | -| `QUIC` | QUIC protocol. | +**[5]:** `net.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`. ### Metric: `http.server.active_requests` @@ -123,11 +115,12 @@ This metric is optional. |---|---|---|---|---| | `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | Required | | `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.flavor` | string | Kind of HTTP protocol used. | `1.0` | Recommended | | `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | | `http.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. | | [`net.host.name`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [2] | `localhost` | Required | | [`net.host.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `8080` | Conditionally Required: [4] | +| [`net.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | +| [`net.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [5] | `3.1.1` | Recommended | **[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. @@ -151,16 +144,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`). -`http.flavor` 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 | -|---|---| -| `1.0` | HTTP/1.0 | -| `1.1` | HTTP/1.1 | -| `2.0` | HTTP/2 | -| `3.0` | HTTP/3 | -| `SPDY` | SPDY protocol. | -| `QUIC` | QUIC protocol. | +**[5]:** `net.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`. ### Metric: `http.server.response.size` @@ -178,11 +162,12 @@ This metric is optional. |---|---|---|---|---| | `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | Required | | `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.flavor` | string | Kind of HTTP protocol used. | `1.0` | Recommended | | `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | | `http.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. | | [`net.host.name`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [2] | `localhost` | Required | | [`net.host.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [3] | `8080` | Conditionally Required: [4] | +| [`net.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | +| [`net.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [5] | `3.1.1` | Recommended | **[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. @@ -206,16 +191,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`). -`http.flavor` 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 | -|---|---| -| `1.0` | HTTP/1.0 | -| `1.1` | HTTP/1.1 | -| `2.0` | HTTP/2 | -| `3.0` | HTTP/3 | -| `SPDY` | SPDY protocol. | -| `QUIC` | QUIC protocol. | +**[5]:** `net.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`. ## HTTP Client @@ -233,11 +209,12 @@ This metric is required. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `http.flavor` | string | Kind of HTTP protocol used. | `1.0` | Recommended | | `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | | `http.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. | | [`net.peer.name`](../../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. [1] | `example.com` | Required | | [`net.peer.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. [2] | `80`; `8080`; `443` | Conditionally Required: [3] | +| [`net.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | +| [`net.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [4] | `3.1.1` | Recommended | | [`net.sock.peer.addr`](../../trace/semantic_conventions/span-general.md) | string | Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). | `127.0.0.1`; `/tmp/mysql.sock` | Recommended | **[1]:** Determined by using the first of the following that applies @@ -252,16 +229,7 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. **[3]:** If not default (`80` for `http` scheme, `443` for `https`). -`http.flavor` 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 | -|---|---| -| `1.0` | HTTP/1.0 | -| `1.1` | HTTP/1.1 | -| `2.0` | HTTP/2 | -| `3.0` | HTTP/3 | -| `SPDY` | SPDY protocol. | -| `QUIC` | QUIC protocol. | +**[4]:** `net.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`. ### Metric: `http.client.request.size` @@ -277,11 +245,12 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `http.flavor` | string | Kind of HTTP protocol used. | `1.0` | Recommended | | `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | | `http.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. | | [`net.peer.name`](../../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. [1] | `example.com` | Required | | [`net.peer.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. [2] | `80`; `8080`; `443` | Conditionally Required: [3] | +| [`net.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | +| [`net.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [4] | `3.1.1` | Recommended | | [`net.sock.peer.addr`](../../trace/semantic_conventions/span-general.md) | string | Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). | `127.0.0.1`; `/tmp/mysql.sock` | Recommended | **[1]:** Determined by using the first of the following that applies @@ -296,16 +265,7 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. **[3]:** If not default (`80` for `http` scheme, `443` for `https`). -`http.flavor` 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 | -|---|---| -| `1.0` | HTTP/1.0 | -| `1.1` | HTTP/1.1 | -| `2.0` | HTTP/2 | -| `3.0` | HTTP/3 | -| `SPDY` | SPDY protocol. | -| `QUIC` | QUIC protocol. | +**[4]:** `net.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`. ### Metric: `http.client.response.size` @@ -321,11 +281,12 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `http.flavor` | string | Kind of HTTP protocol used. | `1.0` | Recommended | | `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | | `http.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. | | [`net.peer.name`](../../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. [1] | `example.com` | Required | | [`net.peer.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. [2] | `80`; `8080`; `443` | Conditionally Required: [3] | +| [`net.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `amqp`; `http`; `mqtt` | Recommended | +| [`net.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [4] | `3.1.1` | Recommended | | [`net.sock.peer.addr`](../../trace/semantic_conventions/span-general.md) | string | Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). | `127.0.0.1`; `/tmp/mysql.sock` | Recommended | **[1]:** Determined by using the first of the following that applies @@ -340,14 +301,5 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup. **[3]:** If not default (`80` for `http` scheme, `443` for `https`). -`http.flavor` 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 | -|---|---| -| `1.0` | HTTP/1.0 | -| `1.1` | HTTP/1.1 | -| `2.0` | HTTP/2 | -| `3.0` | HTTP/3 | -| `SPDY` | SPDY protocol. | -| `QUIC` | QUIC protocol. | +**[4]:** `net.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 014c9cf5d89..6ebe1cdfb6c 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -66,37 +66,29 @@ sections below. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | `http.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.flavor` | string | Kind of HTTP protocol used. | `1.0` | Recommended | | `http.user_agent` | 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 | | `http.request_content_length` | 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_content_length` | 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.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| [`net.sock.family`](span-general.md) | string | Protocol [address family](https://man7.org/linux/man-pages/man7/address_families.7.html) which is used for communication. | `inet`; `inet6` | Conditionally Required: [1] | +| [`net.protocol.name`](span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `spdy`; `quic`; `http` | Recommended | +| [`net.protocol.version`](span-general.md) | string | Version of the application layer protocol used. See note below. [1] | `1.0`; `1.1`; `2.0` | Recommended | +| [`net.sock.family`](span-general.md) | string | Protocol [address family](https://man7.org/linux/man-pages/man7/address_families.7.html) which is used for communication. | `inet`; `inet6` | Conditionally Required: [2] | | [`net.sock.peer.addr`](span-general.md) | string | Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). | `127.0.0.1`; `/tmp/mysql.sock` | Recommended | -| [`net.sock.peer.name`](span-general.md) | string | Remote socket peer name. | `proxy.example.com` | Recommended: [2] | -| [`net.sock.peer.port`](span-general.md) | int | Remote socket peer port. | `16456` | Recommended: [3] | +| [`net.sock.peer.name`](span-general.md) | string | Remote socket peer name. | `proxy.example.com` | Recommended: [3] | +| [`net.sock.peer.port`](span-general.md) | int | Remote socket peer port. | `16456` | Recommended: [4] | -**[1]:** If different than `inet` and if any of `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers of telemetry SHOULD accept both IPv4 and IPv6 formats for the address in `net.sock.peer.addr` if `net.sock.family` is not set. This is to support instrumentations that follow previous versions of this document. +**[1]:** `net.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]:** If available and different from `net.peer.name` and if `net.sock.peer.addr` is set. +**[2]:** If different than `inet` and if any of `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers of telemetry SHOULD accept both IPv4 and IPv6 formats for the address in `net.sock.peer.addr` if `net.sock.family` is not set. This is to support instrumentations that follow previous versions of this document. -**[3]:** If defined for the address family and if different than `net.peer.port` and if `net.sock.peer.addr` is set. +**[3]:** If available and different from `net.peer.name` and if `net.sock.peer.addr` is set. + +**[4]:** If defined for the address family and if different than `net.peer.port` and if `net.sock.peer.addr` is set. Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions: * `http.method` -`http.flavor` 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 | -|---|---| -| `1.0` | HTTP/1.0 | -| `1.1` | HTTP/1.1 | -| `2.0` | HTTP/2 | -| `3.0` | HTTP/3 | -| `SPDY` | SPDY protocol. | -| `QUIC` | QUIC protocol. | - `net.sock.family` 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 648c04d1f54659009a399708cd7d7f755b140964 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 1 Mar 2023 19:40:30 -0800 Subject: [PATCH 05/12] Add change log entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58e5986ba9b..1e3338676a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,10 @@ release. ([#3220](https://github.com/open-telemetry/opentelemetry-specification/pull/3220)) - Remove mention of `net.transport` from HTTP semantic conventions ([#3244](https://github.com/open-telemetry/opentelemetry-specification/pull/3244)) +- Rename `net.app.transport.(name|version)` to `net.transport.(name|version)` + ([#3272](https://github.com/open-telemetry/opentelemetry-specification/pull/3272)) +- Replace `http.flavor` with `net.transport.(name|version)` + ([#3272](https://github.com/open-telemetry/opentelemetry-specification/pull/3272)) ### Compatibility From bbd13ac741584ae47962cae5a73629b7d2f55aa0 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 1 Mar 2023 19:42:03 -0800 Subject: [PATCH 06/12] more --- semantic_conventions/http-common.yaml | 2 +- specification/trace/semantic_conventions/http.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index db886cbc855..11ee816d028 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -16,7 +16,7 @@ groups: brief: '[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).' examples: [200] - ref: net.protocol.name - examples: ['spdy', 'quic', 'http'] + examples: ['http', 'spdy', 'quic'] - ref: net.protocol.version examples: ['1.0', '1.1', '2.0'] diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 6ebe1cdfb6c..15747851a76 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -70,7 +70,7 @@ sections below. | `http.request_content_length` | 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_content_length` | 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.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| [`net.protocol.name`](span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `spdy`; `quic`; `http` | Recommended | +| [`net.protocol.name`](span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `http`; `spdy`; `quic` | Recommended | | [`net.protocol.version`](span-general.md) | string | Version of the application layer protocol used. See note below. [1] | `1.0`; `1.1`; `2.0` | Recommended | | [`net.sock.family`](span-general.md) | string | Protocol [address family](https://man7.org/linux/man-pages/man7/address_families.7.html) which is used for communication. | `inet`; `inet6` | Conditionally Required: [2] | | [`net.sock.peer.addr`](span-general.md) | string | Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). | `127.0.0.1`; `/tmp/mysql.sock` | Recommended | From d3ed36d8248374a705d8ab9f3fd94175b17a9e08 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 1 Mar 2023 21:43:34 -0800 Subject: [PATCH 07/12] Update CHANGELOG.md Co-authored-by: Liudmila Molkova --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e3338676a4..f5840b2e107 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,7 @@ release. ([#3220](https://github.com/open-telemetry/opentelemetry-specification/pull/3220)) - Remove mention of `net.transport` from HTTP semantic conventions ([#3244](https://github.com/open-telemetry/opentelemetry-specification/pull/3244)) -- Rename `net.app.transport.(name|version)` to `net.transport.(name|version)` +- Rename `net.app.protocol.(name|version)` to `net.protocol.(name|version)` ([#3272](https://github.com/open-telemetry/opentelemetry-specification/pull/3272)) - Replace `http.flavor` with `net.transport.(name|version)` ([#3272](https://github.com/open-telemetry/opentelemetry-specification/pull/3272)) From 56e3358bf25d569b489b426d91a0e139dbc5b2f5 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 1 Mar 2023 21:44:40 -0800 Subject: [PATCH 08/12] Add schema translation --- schemas/1.19.0 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/schemas/1.19.0 b/schemas/1.19.0 index 5edbaeeb32a..26403ab6193 100644 --- a/schemas/1.19.0 +++ b/schemas/1.19.0 @@ -12,6 +12,11 @@ versions: - rename_attributes: attribute_map: faas.id: cloud.resource_id + # https://github.com/open-telemetry/opentelemetry-specification/pull/3272 + - rename_attributes: + attribute_map: + net.app.protocol.name: net.protocol.name + net.app.protocol.version: net.protocol.version 1.18.0: 1.17.0: spans: From 46a0d8b7b449995db6b6cc024aaff4d1a31f539a Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 1 Mar 2023 21:47:19 -0800 Subject: [PATCH 09/12] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5840b2e107..26696bed0d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,7 +48,7 @@ release. ([#3244](https://github.com/open-telemetry/opentelemetry-specification/pull/3244)) - Rename `net.app.protocol.(name|version)` to `net.protocol.(name|version)` ([#3272](https://github.com/open-telemetry/opentelemetry-specification/pull/3272)) -- Replace `http.flavor` with `net.transport.(name|version)` +- Replace `http.flavor` with `net.protocol.(name|version)` ([#3272](https://github.com/open-telemetry/opentelemetry-specification/pull/3272)) ### Compatibility From bcafc89f39201b7220fe2c1eadb0f8946dbfb876 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 1 Mar 2023 21:50:20 -0800 Subject: [PATCH 10/12] if not default --- semantic_conventions/http-common.yaml | 4 +++- specification/trace/semantic_conventions/http.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index 11ee816d028..faf7ff1ba84 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -16,7 +16,9 @@ groups: brief: '[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).' examples: [200] - ref: net.protocol.name - examples: ['http', 'spdy', 'quic'] + examples: ['http', 'spdy'] + requirement_level: + recommended: if not default (`http`). - ref: net.protocol.version examples: ['1.0', '1.1', '2.0'] diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 15747851a76..7514bd4e643 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -70,7 +70,7 @@ sections below. | `http.request_content_length` | 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_content_length` | 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.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| [`net.protocol.name`](span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `http`; `spdy`; `quic` | Recommended | +| [`net.protocol.name`](span-general.md) | string | Application layer protocol used. The value SHOULD be normalized to lowercase. | `http`; `spdy` | Recommended: if not default (`http`). | | [`net.protocol.version`](span-general.md) | string | Version of the application layer protocol used. See note below. [1] | `1.0`; `1.1`; `2.0` | Recommended | | [`net.sock.family`](span-general.md) | string | Protocol [address family](https://man7.org/linux/man-pages/man7/address_families.7.html) which is used for communication. | `inet`; `inet6` | Conditionally Required: [2] | | [`net.sock.peer.addr`](span-general.md) | string | Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). | `127.0.0.1`; `/tmp/mysql.sock` | Recommended | From c5b4f5d05e727adbdfcb3a56495d798ec9a6a44e Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Mon, 6 Mar 2023 19:30:35 -0800 Subject: [PATCH 11/12] Update schema translation to 1.20.0 --- schemas/1.20.0 | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 schemas/1.20.0 diff --git a/schemas/1.20.0 b/schemas/1.20.0 new file mode 100644 index 00000000000..83d652be330 --- /dev/null +++ b/schemas/1.20.0 @@ -0,0 +1,89 @@ +file_format: 1.1.0 +schema_url: https://opentelemetry.io/schemas/1.20.0 +versions: + 1.20.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/3272 + - rename_attributes: + attribute_map: + net.app.protocol.name: net.protocol.name + net.app.protocol.version: net.protocol.version + 1.19.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/3209 + - rename_attributes: + attribute_map: + faas.execution: faas.invocation_id + # https://github.com/open-telemetry/opentelemetry-specification/pull/3188 + - rename_attributes: + attribute_map: + faas.id: cloud.resource_id + # https://github.com/open-telemetry/opentelemetry-specification/pull/3190 + - rename_attributes: + attribute_map: + http.user_agent: user_agent.original + resources: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/3190 + - rename_attributes: + attribute_map: + browser.user_agent: user_agent.original + 1.18.0: + 1.17.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/2957 + - rename_attributes: + attribute_map: + messaging.consumer_id: messaging.consumer.id + messaging.protocol: net.app.protocol.name + messaging.protocol_version: net.app.protocol.version + messaging.destination: messaging.destination.name + messaging.temp_destination: messaging.destination.temporary + messaging.destination_kind: messaging.destination.kind + messaging.message_id: messaging.message.id + messaging.conversation_id: messaging.message.conversation_id + messaging.message_payload_size_bytes: messaging.message.payload_size_bytes + messaging.message_payload_compressed_size_bytes: messaging.message.payload_compressed_size_bytes + messaging.rabbitmq.routing_key: messaging.rabbitmq.destination.routing_key + messaging.kafka.message_key: messaging.kafka.message.key + messaging.kafka.partition: messaging.kafka.destination.partition + messaging.kafka.tombstone: messaging.kafka.message.tombstone + messaging.rocketmq.message_type: messaging.rocketmq.message.type + messaging.rocketmq.message_tag: messaging.rocketmq.message.tag + messaging.rocketmq.message_keys: messaging.rocketmq.message.keys + messaging.kafka.consumer_group: messaging.kafka.consumer.group + 1.16.0: + 1.15.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/2743 + - rename_attributes: + attribute_map: + http.retry_count: http.resend_count + 1.14.0: + 1.13.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/2614 + - rename_attributes: + attribute_map: + net.peer.ip: net.sock.peer.addr + net.host.ip: net.sock.host.addr + 1.12.0: + 1.11.0: + 1.10.0: + 1.9.0: + 1.8.0: + spans: + changes: + - rename_attributes: + attribute_map: + db.cassandra.keyspace: db.name + db.hbase.namespace: db.name + 1.7.0: + 1.6.1: + 1.5.0: + 1.4.0: From 2bd3a1b9df8d249da5721188949aed7073a2b4a1 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Mon, 6 Mar 2023 19:32:39 -0800 Subject: [PATCH 12/12] Fix --- schemas/1.19.0 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/schemas/1.19.0 b/schemas/1.19.0 index a91cd51c68d..bb8e2168f68 100644 --- a/schemas/1.19.0 +++ b/schemas/1.19.0 @@ -16,11 +16,6 @@ versions: - rename_attributes: attribute_map: http.user_agent: user_agent.original - # https://github.com/open-telemetry/opentelemetry-specification/pull/3272 - - rename_attributes: - attribute_map: - net.app.protocol.name: net.protocol.name - net.app.protocol.version: net.protocol.version resources: changes: # https://github.com/open-telemetry/opentelemetry-specification/pull/3190