Skip to content

Commit

Permalink
net.peer.name clarification for HTTP client semconv (#3276)
Browse files Browse the repository at this point in the history
Fixes #3273

## Changes

Clarifies that if an HTTP client request is explicitly made to an IP
address, e.g. `http://x.x.x.x:8080`, then
`net.peer.name` SHOULD be the IP address `x.x.x.x`.
  • Loading branch information
trask authored Mar 6, 2023
1 parent d10ce84 commit fe6f924
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ release.
([#3220](https://github.com/open-telemetry/opentelemetry-specification/pull/3220))
- Remove mention of `net.transport` from HTTP semantic conventions
([#3244](https://github.com/open-telemetry/opentelemetry-specification/pull/3244))
- Clarifies that if an HTTP client request is explicitly made to an IP address,
e.g. `http://x.x.x.x:8080`, then `net.peer.name` SHOULD be the IP address `x.x.x.x`
([#3276](https://github.com/open-telemetry/opentelemetry-specification/pull/3276))
- Mark `net.sock.host.port` as conditionally required.
([#3246](https://github.com/open-telemetry/opentelemetry-specification/pull/3246))

Expand Down
3 changes: 2 additions & 1 deletion semantic_conventions/trace/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ groups:
if it's sent in absolute-form
- Host identifier of the `Host` header
SHOULD NOT be set if capturing it would require an extra DNS lookup.
If an HTTP client request is explicitly made to an IP address, e.g. `http://x.x.x.x:8080`, then
`net.peer.name` SHOULD be the IP address `x.x.x.x`. A DNS lookup SHOULD NOT be used.
- ref: net.peer.port
sampling_relevant: true
requirement_level:
Expand Down
3 changes: 2 additions & 1 deletion specification/trace/semantic_conventions/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ before any HTTP-redirects that may happen when executing the request.
if it's sent in absolute-form
- Host identifier of the `Host` header

SHOULD NOT be set if capturing it would require an extra DNS lookup.
If an HTTP client request is explicitly made to an IP address, e.g. `http://x.x.x.x:8080`, then
`net.peer.name` SHOULD be the IP address `x.x.x.x`. A DNS lookup SHOULD NOT be used.

**[4]:** When [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) is absolute URI, `net.peer.name` MUST match URI port identifier, otherwise it MUST match `Host` header port identifier.

Expand Down

0 comments on commit fe6f924

Please sign in to comment.