Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move net.peer.name from http common to http client #2446

Merged
merged 10 commits into from
Apr 2, 2022
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ 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,
and note added that it SHOULD NOT be set if capturing it requires a reverse DNS lookup.
([#2446](https://github.com/open-telemetry/opentelemetry-specification/pull/2446))

### Compatibility

Expand Down
7 changes: 5 additions & 2 deletions semantic_conventions/trace/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -125,6 +123,11 @@ groups:
extends: http
span_kind: client
brief: 'Semantic Convention for HTTP Client'
attributes:
- ref: net.peer.name
sampling_relevant: true
trask marked this conversation as resolved.
Show resolved Hide resolved
note: >
`net.peer.name` SHOULD NOT be set if capturing it requires a reverse DNS lookup.
constraints:
- any_of:
- [http.url]
Expand Down
11 changes: 9 additions & 2 deletions specification/trace/semantic_conventions/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]/`. In such case the attribute's value should be `https://www.example.com/`.
Expand All @@ -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)
<!-- endsemconv -->

Expand Down Expand Up @@ -146,13 +144,22 @@ If set, `http.url` must be the originally requested URL,
before any HTTP-redirects that may happen when executing the request.

<!-- semconv http.client -->
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| [`net.peer.name`](span-general.md) | string | Remote hostname or similar, see note below. [1] | `example.com` | See below |

**[1]:** `net.peer.name` SHOULD NOT be set if capturing it requires a reverse DNS lookup.

**Additional attribute requirements:** At least one of the following sets of attributes is required:

* `http.url`
* `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:
trask marked this conversation as resolved.
Show resolved Hide resolved

* [`net.peer.name`](span-general.md)
<!-- endsemconv -->

Note that in some cases `http.host` might be different
Expand Down