Skip to content

Commit

Permalink
Change network.transport from recommended to opt-in in the HTTP sem…
Browse files Browse the repository at this point in the history
…conv (#402)

Co-authored-by: Joao Grassi <joao.grassi@dynatrace.com>
  • Loading branch information
trask and joaopgrassi authored Oct 17, 2023
1 parent adc0187 commit 7680dc8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ release.
([#374](https://github.com/open-telemetry/semantic-conventions/pull/374))
- BREAKING: Define url.scheme in terms of logical operation in HTTP server semconv.
([#376](https://github.com/open-telemetry/semantic-conventions/pull/376))
- BREAKING: Change `network.transport` from recommended to opt-in in HTTP semconv.
([#402](https://github.com/open-telemetry/semantic-conventions/pull/402))

### Features

Expand Down
14 changes: 4 additions & 10 deletions docs/http/http-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ sections below.
| [`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. |
| [`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`). |
| [`network.protocol.version`](../general/attributes.md) | string | Version of the protocol specified in `network.protocol.name`. [7] | `1.0`; `1.1`; `2`; `3` | Recommended |
| [`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] |
| [`network.type`](../general/attributes.md) | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. [10] | `ipv4`; `ipv6` | Recommended |
| [`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 |
| [`network.type`](../general/attributes.md) | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. [9] | `ipv4`; `ipv6` | Recommended |
| `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 the request fails with an error before response status code was sent or received,
Expand Down Expand Up @@ -175,15 +175,9 @@ The attribute value MUST consist of either multiple header values as an array of

**[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`.

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

Consider always setting the transport when setting a port number, since
a port number is ambiguous without knowing the transport, for example
different processes could be listening on TCP port 12345 and UDP port 12345.

**[9]:** If not default (`tcp` for `HTTP/1.1` and `HTTP/2`, `udp` for `HTTP/3`).

**[10]:** The value SHOULD be normalized to lowercase.
**[9]:** The value SHOULD be normalized to lowercase.

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

Expand Down
6 changes: 4 additions & 2 deletions model/trace/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ groups:
sampling_relevant: true
requirement_level: required
- ref: network.transport
requirement_level:
conditionally_required: If not default (`tcp` for `HTTP/1.1` and `HTTP/2`, `udp` for `HTTP/3`).
requirement_level: opt_in
note: >
Generally `tcp` for `HTTP/1.0`, `HTTP/1.1`, and `HTTP/2`. Generally `udp` for `HTTP/3`.
Other obscure implementations are possible.
- ref: network.type
- ref: user_agent.original

Expand Down

0 comments on commit 7680dc8

Please sign in to comment.