From ac3086a1c1a87532cf20abba463068ac1bd16582 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Thu, 12 Oct 2023 10:21:02 -0700 Subject: [PATCH] Make server.port required on HTTP server semconv --- CHANGELOG.md | 3 +++ docs/http/http-spans.md | 2 +- model/http-common.yaml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f6fa6005d..7c9f371490 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ release. ## Unreleased +- Change `server.port` from recommended to conditionally required on HTTP server semconv. + ([#399](https://github.com/open-telemetry/semantic-conventions/pull/399)) + ## v1.22.0 (2023-10-12) - Remove experimental Kafka metrics ([#338](https://github.com/open-telemetry/semantic-conventions/pull/338)) diff --git a/docs/http/http-spans.md b/docs/http/http-spans.md index a127fde446..3c9cd20bf1 100644 --- a/docs/http/http-spans.md +++ b/docs/http/http-spans.md @@ -374,7 +374,7 @@ For an HTTP server span, `SpanKind` MUST be `Server`. | [`network.peer.address`](../general/attributes.md) | string | Peer address of the network connection - IP address or Unix domain socket name. | `10.1.2.80`; `/tmp/my.sock` | Recommended | | [`network.peer.port`](../general/attributes.md) | int | Peer port number of the network connection. | `65123` | Recommended | | [`server.address`](../general/attributes.md) | string | Name of the local HTTP server that received the request. [4] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Recommended | -| [`server.port`](../general/attributes.md) | int | Port of the local HTTP server that received the request. [5] | `80`; `8080`; `443` | Recommended: [6] | +| [`server.port`](../general/attributes.md) | int | Port of the local HTTP server that received the request. [5] | `80`; `8080`; `443` | Conditionally Required: [6] | | [`url.path`](../url/url.md) | string | The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component [7] | `/search` | Required | | [`url.query`](../url/url.md) | string | The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component [8] | `q=OpenTelemetry` | Conditionally Required: If and only if one was received/sent. | | [`url.scheme`](../url/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | diff --git a/model/http-common.yaml b/model/http-common.yaml index 54e53fc72a..9a23c24763 100644 --- a/model/http-common.yaml +++ b/model/http-common.yaml @@ -95,7 +95,7 @@ groups: if it's sent in absolute-form. - Port identifier of the `Host` header requirement_level: - recommended: If not default (`80` for `http` scheme, `443` for `https`). + conditionally_required: If not default (`80` for `http` scheme, `443` for `https`). - ref: url.scheme requirement_level: required examples: ["http", "https"]