diff --git a/CHANGELOG.md b/CHANGELOG.md index 8abf6416d01..8b907885861 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,10 @@ release. - Fix grammatical number of metric units. ([#3298](https://github.com/open-telemetry/opentelemetry-specification/pull/3298)) +- 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.protocol.(name|version)` + ([#3272](https://github.com/open-telemetry/opentelemetry-specification/pull/3272)) ### Compatibility 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: diff --git a/semantic_conventions/http-common.yaml b/semantic_conventions/http-common.yaml index 8ca6b7b323d..faf7ff1ba84 100644 --- a/semantic_conventions/http-common.yaml +++ b/semantic_conventions/http-common.yaml @@ -15,31 +15,12 @@ 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: ['http', 'spdy'] + requirement_level: + recommended: if not default (`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 f8696ac8b6d..2ae7581c4e1 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 diff --git a/semantic_conventions/trace/general.yaml b/semantic_conventions/trace/general.yaml index a8a4dbe77c8..61dac0f0ea3 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 diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index c5cb81a5db0..807e5e5458f 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 27d1d954e26..636683beeb0 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.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. | `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 | -| [`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] | | `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]:** 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 | 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 95fa45ff46b..73e151dea56 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.