Skip to content

Commit

Permalink
review: req level on net.sock.host.pot and nits
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Jul 8, 2022
1 parent 87d0c25 commit 1ffc461
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ release.
- Add `http.*.*.size` metric semantic conventions for tracking size of requests
/ responses for http servers / clients
([#2588](https://github.com/open-telemetry/opentelemetry-specification/pull/2588)).
- BREAKING: rename `net.peer.ip` to `net.sock.peer.addr` and `net.host.ip` to `net.sock.host.addr`.
- BREAKING: rename `net.peer.ip` to `net.sock.peer.addr`, `net.host.ip` to `net.sock.host.addr`,
`net.peer.name` to `net.sock.peer.name` for socket-level instrumentation.
Define socket-level attributes and clarify logical peer and host attributes meaning.
Expand Down
4 changes: 3 additions & 1 deletion semantic_conventions/trace/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ groups:
examples: '192.168.0.1'
- id: sock.host.port
type: int
brief: 'Local socket peer port (if defined for the address family).'
brief: 'Local socket port number.'
requirement_level:
recommended: If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set.
examples: 35555
- id: host.connection.type
type:
Expand Down
4 changes: 0 additions & 4 deletions semantic_conventions/trace/rpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ groups:
- ref: net.host.name
- ref: net.sock.host.addr
- ref: net.sock.host.port
requirement_level:
recommended: If different than `net.host.port` and if `net.sock.host.addr` is set.
- ref: net.sock.family
requirement_level:
conditionally_required: If and only if `net.sock.peer.addr` or `net.sock.host.addr` are set.

- id: rpc.grpc
prefix: rpc.grpc
Expand Down
4 changes: 3 additions & 1 deletion specification/trace/semantic_conventions/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ If the route cannot be determined, the `name` attribute MUST be set as defined i
| [`net.host.name`](span-general.md) | string | Host component of the ["origin"](https://www.rfc-editor.org/rfc/rfc9110.html#section-3.6) server HTTP request is sent to. [3] | `localhost` | See below |
| [`net.host.port`](span-general.md) | int | Port component of the ["origin"](https://www.rfc-editor.org/rfc/rfc9110.html#section-3.6) server HTTP request is sent to. [4] | `8080` | See below |
| [`net.sock.host.addr`](span-general.md) | string | Local socket address. Useful in case of a multi-IP host.' | `192.168.0.1` | Recommended |
| [`net.sock.host.port`](span-general.md) | int | Local socket peer port (if defined for the address family). | `35555` | Recommended |
| [`net.sock.host.port`](span-general.md) | int | Local socket port number. | `35555` | Recommended: [5] |

**[1]:** `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available.

Expand All @@ -270,6 +270,8 @@ the closest proxy.

**[4]:** When [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) is absolute URI, `net.host.port` SHOULD match URI port component, otherwise `Host` header port component SHOULD be used.

**[5]:** If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set.

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

* `http.scheme`, `http.host`, `http.target`
Expand Down
6 changes: 3 additions & 3 deletions specification/trace/semantic_conventions/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ Generally, a user SHOULD NOT set `peer.service` to a fully qualified RPC service
| [`net.host.name`](span-general.md) | string | Logical local hostname or similar, see note below. | `localhost` | Recommended |
| [`net.sock.family`](span-general.md) | string | Protocol [address family](https://man7.org/linux/man-pages/man7/address_families.7.html) which is used for communication. | `inet6`; `bluetooth` | Conditionally Required: [1] |
| [`net.sock.host.addr`](span-general.md) | string | Local socket address. Useful in case of a multi-IP host.' | `192.168.0.1` | Recommended |
| [`net.sock.host.port`](span-general.md) | int | Local socket peer port (if defined for the address family). | `35555` | Recommended: [2] |
| [`net.sock.host.port`](span-general.md) | int | Local socket port number. | `35555` | Recommended: [2] |

**[1]:** If and only if `net.sock.peer.addr` or `net.sock.host.addr` are set.
**[1]:** If different than `inet` and if any of `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers of telemetry SHOULD expect to receive IPv6 address in `net.sock.peer.addr` without `net.sock.family` coming from instrumentations that follow previous versions of this document.

**[2]:** If different than `net.host.port` and if `net.sock.host.addr` is set.
**[2]:** If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set.
<!-- endsemconv -->

### Events
Expand Down
4 changes: 3 additions & 1 deletion specification/trace/semantic_conventions/span-general.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ the `net.peer.*` properties of a client are equal to the `net.host.*` properties
| `net.host.name` | string | Logical local hostname or similar, see note below. | `localhost` | Recommended |
| `net.host.port` | int | Logical local port number, preferably the one that the peer used to connect | `8080` | Recommended |
| `net.sock.host.addr` | string | Local socket address. Useful in case of a multi-IP host.' | `192.168.0.1` | Recommended |
| `net.sock.host.port` | int | Local socket peer port (if defined for the address family). | `35555` | Recommended |
| `net.sock.host.port` | int | Local socket port number. | `35555` | Recommended: [6] |
| `net.host.connection.type` | string | The internet connection type currently being used by the host. | `wifi` | Recommended |
| `net.host.connection.subtype` | string | This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. | `LTE` | Recommended |
| `net.host.carrier.name` | string | The name of the mobile carrier. | `sprint` | Recommended |
Expand All @@ -71,6 +71,8 @@ the `net.peer.*` properties of a client are equal to the `net.host.*` properties

**[5]:** `net.peer.name` SHOULD NOT be set if capturing it would require an extra DNS lookup.

**[6]:** If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set.

`net.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used.

| Value | Description |
Expand Down

0 comments on commit 1ffc461

Please sign in to comment.