From 257ddfd641ce3c5f632e8ed9e8052bcf805daf14 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 22 Feb 2023 07:54:41 -0800 Subject: [PATCH 1/4] Make net.sock.host.port conditionally required --- semantic_conventions/trace/general.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semantic_conventions/trace/general.yaml b/semantic_conventions/trace/general.yaml index 54403442946..b2ed9c52644 100644 --- a/semantic_conventions/trace/general.yaml +++ b/semantic_conventions/trace/general.yaml @@ -106,7 +106,7 @@ groups: type: int brief: 'Local socket port number.' requirement_level: - recommended: If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set. + conditionally_required: If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set. examples: 35555 - id: host.connection.type type: From c8969052ab646c1534f23012e7cb0393ef1e81e6 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 22 Feb 2023 08:07:08 -0800 Subject: [PATCH 2/4] make table-generation --- specification/trace/semantic_conventions/http.md | 2 +- specification/trace/semantic_conventions/rpc.md | 2 +- specification/trace/semantic_conventions/span-general.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 8bfc9bbfb1d..2faa7f6e303 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -251,7 +251,7 @@ If the route cannot be determined, the `name` attribute MUST be set as defined i | [`net.host.name`](span-general.md) | string | Name of the local HTTP server that received the request. [3] | `localhost` | Required | | [`net.host.port`](span-general.md) | int | Port of the local HTTP server that received the request. [4] | `8080` | Conditionally Required: [5] | | [`net.sock.host.addr`](span-general.md) | string | Local socket address. Useful in case of a multi-IP host. | `192.168.0.1` | Optional | -| [`net.sock.host.port`](span-general.md) | int | Local socket port number. | `35555` | Recommended: [6] | +| [`net.sock.host.port`](span-general.md) | int | Local socket port number. | `35555` | Conditionally Required: [6] | **[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. diff --git a/specification/trace/semantic_conventions/rpc.md b/specification/trace/semantic_conventions/rpc.md index b78b9647dae..5475f5d4a7e 100644 --- a/specification/trace/semantic_conventions/rpc.md +++ b/specification/trace/semantic_conventions/rpc.md @@ -127,7 +127,7 @@ Generally, a user SHOULD NOT set `peer.service` to a fully qualified RPC service | [`net.host.name`](span-general.md) | string | Logical local hostname or similar, see note below. | `localhost` | 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: [1] | | [`net.sock.host.addr`](span-general.md) | string | Local socket address. Useful in case of a multi-IP host. | `192.168.0.1` | Recommended | -| [`net.sock.host.port`](span-general.md) | int | Local socket port number. | `35555` | Recommended: [2] | +| [`net.sock.host.port`](span-general.md) | int | Local socket port number. | `35555` | Conditionally Required: [2] | **[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. diff --git a/specification/trace/semantic_conventions/span-general.md b/specification/trace/semantic_conventions/span-general.md index b0091f667b9..7a2795fc45e 100644 --- a/specification/trace/semantic_conventions/span-general.md +++ b/specification/trace/semantic_conventions/span-general.md @@ -52,7 +52,7 @@ the `net.peer.*` properties of a client are equal to the `net.host.*` properties | `net.host.name` | string | Logical local hostname or similar, see note below. | `localhost` | Recommended | | `net.host.port` | int | Logical local port number, preferably the one that the peer used to connect | `8080` | Recommended | | `net.sock.host.addr` | string | Local socket address. Useful in case of a multi-IP host. | `192.168.0.1` | Recommended | -| `net.sock.host.port` | int | Local socket port number. | `35555` | Recommended: [6] | +| `net.sock.host.port` | int | Local socket port number. | `35555` | Conditionally Required: [6] | | `net.host.connection.type` | string | The internet connection type currently being used by the host. | `wifi` | Recommended | | `net.host.connection.subtype` | string | This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. | `LTE` | Recommended | | `net.host.carrier.name` | string | The name of the mobile carrier. | `sprint` | Recommended | From deed8ebf5e1d470758f5811b3993dcbe14897170 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 22 Feb 2023 10:44:57 -0800 Subject: [PATCH 3/4] Add change log entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac9c8edf443..15b6bd66bb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ release. ([#3209](https://github.com/open-telemetry/opentelemetry-specification/pull/3209)) - Add Connect RPC specific conventions ([#3116](https://github.com/open-telemetry/opentelemetry-specification/pull/3116)) +- Mark `net.sock.host.port` as conditionally required. + ([#3246](https://github.com/open-telemetry/opentelemetry-specification/pull/3246)) ### Compatibility From 8d2dc68f01db3fefc431fa91ef921b7cdbe9ddc5 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Tue, 28 Feb 2023 20:10:08 -0800 Subject: [PATCH 4/4] Update semantic_conventions/trace/general.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christian Neumüller --- semantic_conventions/trace/general.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semantic_conventions/trace/general.yaml b/semantic_conventions/trace/general.yaml index b2ed9c52644..a8a4dbe77c8 100644 --- a/semantic_conventions/trace/general.yaml +++ b/semantic_conventions/trace/general.yaml @@ -106,7 +106,7 @@ groups: type: int brief: 'Local socket port number.' requirement_level: - conditionally_required: If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set. + conditionally_required: If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set. In other cases, it is still recommended to set this. examples: 35555 - id: host.connection.type type: