Skip to content

Commit 7680dc8

Browse files
traskjoaopgrassi
andauthored
Change network.transport from recommended to opt-in in the HTTP semconv (open-telemetry#402)
Co-authored-by: Joao Grassi <[email protected]>
1 parent adc0187 commit 7680dc8

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ release.
1313
([#374](https://github.com/open-telemetry/semantic-conventions/pull/374))
1414
- BREAKING: Define url.scheme in terms of logical operation in HTTP server semconv.
1515
([#376](https://github.com/open-telemetry/semantic-conventions/pull/376))
16+
- BREAKING: Change `network.transport` from recommended to opt-in in HTTP semconv.
17+
([#402](https://github.com/open-telemetry/semantic-conventions/pull/402))
1618

1719
### Features
1820

docs/http/http-spans.md

+4-10
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ sections below.
125125
| [`http.response.status_code`](../attributes-registry/http.md) | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: If and only if one was received/sent. |
126126
| [`network.protocol.name`](../general/attributes.md) | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. [6] | `http`; `spdy` | Recommended: if not default (`http`). |
127127
| [`network.protocol.version`](../general/attributes.md) | string | Version of the protocol specified in `network.protocol.name`. [7] | `1.0`; `1.1`; `2`; `3` | Recommended |
128-
| [`network.transport`](../general/attributes.md) | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). [8] | `tcp`; `udp` | Conditionally Required: [9] |
129-
| [`network.type`](../general/attributes.md) | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. [10] | `ipv4`; `ipv6` | Recommended |
128+
| [`network.transport`](../general/attributes.md) | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). [8] | `tcp`; `udp` | Opt-In |
129+
| [`network.type`](../general/attributes.md) | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. [9] | `ipv4`; `ipv6` | Recommended |
130130
| `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 |
131131

132132
**[1]:** If the request fails with an error before response status code was sent or received,
@@ -175,15 +175,9 @@ The attribute value MUST consist of either multiple header values as an array of
175175

176176
**[7]:** `network.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`.
177177

178-
**[8]:** The value SHOULD be normalized to lowercase.
178+
**[8]:** Generally `tcp` for `HTTP/1.0`, `HTTP/1.1`, and `HTTP/2`. Generally `udp` for `HTTP/3`. Other obscure implementations are possible.
179179

180-
Consider always setting the transport when setting a port number, since
181-
a port number is ambiguous without knowing the transport, for example
182-
different processes could be listening on TCP port 12345 and UDP port 12345.
183-
184-
**[9]:** If not default (`tcp` for `HTTP/1.1` and `HTTP/2`, `udp` for `HTTP/3`).
185-
186-
**[10]:** The value SHOULD be normalized to lowercase.
180+
**[9]:** The value SHOULD be normalized to lowercase.
187181

188182
Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions:
189183

model/trace/http.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ groups:
2020
sampling_relevant: true
2121
requirement_level: required
2222
- ref: network.transport
23-
requirement_level:
24-
conditionally_required: If not default (`tcp` for `HTTP/1.1` and `HTTP/2`, `udp` for `HTTP/3`).
23+
requirement_level: opt_in
24+
note: >
25+
Generally `tcp` for `HTTP/1.0`, `HTTP/1.1`, and `HTTP/2`. Generally `udp` for `HTTP/3`.
26+
Other obscure implementations are possible.
2527
- ref: network.type
2628
- ref: user_agent.original
2729

0 commit comments

Comments
 (0)