diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c09183b198..a047af49195 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,8 @@ release. ([#2290](https://github.com/open-telemetry/opentelemetry-specification/pull/2290)) - Add semantic conventions for [CloudEvents](https://cloudevents.io). ([#1978](https://github.com/open-telemetry/opentelemetry-specification/pull/1978)) +- `net.peer.name` moved from common http attributes to just client http attributes. + ([#9999](https://github.com/open-telemetry/opentelemetry-specification/pull/9999)) ### Compatibility diff --git a/semantic_conventions/trace/http.yaml b/semantic_conventions/trace/http.yaml index 85b9febb9f4..898eadc69c9 100644 --- a/semantic_conventions/trace/http.yaml +++ b/semantic_conventions/trace/http.yaml @@ -111,8 +111,6 @@ groups: required: conditional: If and only if a request was retried. examples: 3 - - ref: net.peer.name - sampling_relevant: true - ref: net.peer.ip sampling_relevant: true - ref: net.peer.port @@ -125,6 +123,9 @@ groups: extends: http span_kind: client brief: 'Semantic Convention for HTTP Client' + attributes: + - ref: net.peer.name + sampling_relevant: true constraints: - any_of: - [http.url] diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 16806a1a45e..a29d343e8a5 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -75,7 +75,6 @@ Don't set the span status description if the reason can be inferred from `http.s | `http.response_content_length_uncompressed` | int | The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. | `5493` | No | | `http.retry_count` | int | The ordinal number of request re-sending attempt. | `3` | If and only if a request was retried. | | [`net.peer.ip`](span-general.md) | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | No | -| [`net.peer.name`](span-general.md) | string | Remote hostname or similar, see note below. | `example.com` | No | | [`net.peer.port`](span-general.md) | int | Remote port number. | `80`; `8080`; `443` | No | **[1]:** `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. @@ -102,7 +101,6 @@ Following attributes MUST be provided **at span creation time** (when provided a * `http.host` * `http.scheme` * [`net.peer.ip`](span-general.md) -* [`net.peer.name`](span-general.md) * [`net.peer.port`](span-general.md) @@ -146,6 +144,9 @@ If set, `http.url` must be the originally requested URL, before any HTTP-redirects that may happen when executing the request. +| Attribute | Type | Description | Examples | Required | +|---|---|---|---|---| +| [`net.peer.name`](span-general.md) | string | Remote hostname or similar, see note below. | `example.com` | See below | **Additional attribute requirements:** At least one of the following sets of attributes is required: @@ -153,6 +154,10 @@ before any HTTP-redirects that may happen when executing the request. * `http.scheme`, `http.host`, `http.target` * `http.scheme`, [`net.peer.name`](span-general.md), [`net.peer.port`](span-general.md), `http.target` * `http.scheme`, [`net.peer.ip`](span-general.md), [`net.peer.port`](span-general.md), `http.target` + +Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions: + +* [`net.peer.name`](span-general.md) Note that in some cases `http.host` might be different