From d31b014b1f0776a09afe4277e63f418e541ea703 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Mon, 19 Jun 2023 10:34:08 -0700 Subject: [PATCH] Make `url.query` conditionally required for HTTP spans (#118) --- CHANGELOG.md | 2 ++ semantic_conventions/trace/http.yaml | 2 ++ specification/trace/semantic_conventions/http.md | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ed63b7335..ff5be5d0f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,3 +84,5 @@ release. ([#55](https://github.com/open-telemetry/semantic-conventions/pull/55)) - Split out sections for proposed stable JVM metrics and experimental JVM metrics. ([#56](https://github.com/open-telemetry/semantic-conventions/pull/56)) +- Make `url.query` conditionally required for HTTP spans. + ([#118](https://github.com/open-telemetry/semantic-conventions/pull/118)) diff --git a/semantic_conventions/trace/http.yaml b/semantic_conventions/trace/http.yaml index 2b5ac99867..7e35b962c4 100644 --- a/semantic_conventions/trace/http.yaml +++ b/semantic_conventions/trace/http.yaml @@ -138,6 +138,8 @@ groups: requirement_level: required sampling_relevant: true - ref: url.query + requirement_level: + conditionally_required: If and only if one was received/sent. sampling_relevant: true - ref: url.scheme sampling_relevant: true diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index d1238e9bcc..015dbfaad9 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -298,7 +298,7 @@ If the route cannot be determined, the `name` attribute MUST be set as defined i | [`server.socket.address`](span-general.md) | string | Local socket address. Useful in case of a multi-IP host. | `10.5.3.2` | Opt-In | | [`server.socket.port`](span-general.md) | int | Local socket port. Useful in case of a multi-port host. | `16456` | Opt-In | | `url.path` | string | The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component [7] | `/search` | Required | -| `url.query` | string | The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component [8] | `q=OpenTelemetry` | Recommended | +| `url.query` | 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` | 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.