Skip to content

Commit

Permalink
Move net.peer.name from http common to http client
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Mar 25, 2022
1 parent 8cf1c75 commit 1b29bdd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 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,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]
Expand Down
9 changes: 7 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,20 @@ 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. | `example.com` | See below |

**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:

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

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

0 comments on commit 1b29bdd

Please sign in to comment.