Skip to content

Commit

Permalink
Last network remodel
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Sep 13, 2023
1 parent 58c52c5 commit ee56e33
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 86 deletions.
23 changes: 7 additions & 16 deletions model/client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,22 @@ groups:
note: >
When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent
the client address behind any intermediaries (e.g. proxies) if it's available.
examples: ['/tmp/my.sock', '10.1.2.80']
examples: ['client.example.com', '10.1.2.80', '/tmp/my.sock']
- id: port
type: int
brief: Client port number.
examples: [65123]
note: >
When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent
the client port behind any intermediaries (e.g. proxies) if it's available.
- id: socket.address
- id: ip
type: string
brief: Client address of the socket connection - IP address or Unix domain socket name.
brief: Client IP address.
note: >
When observed from the server side, this SHOULD represent the immediate client peer address.
When observed from the server side, and when communicating through an intermediary, `client.ip` SHOULD represent
the client IP address behind any intermediaries (e.g. proxies) if it's available.
When observed from the client side, this SHOULD represent the physical client address.
examples: ['/tmp/my.sock', '127.0.0.1']
When observed from the client side, this SHOULD represent the physical client IP address.
examples: ['127.0.0.1']
requirement_level:
recommended: If different than `client.address`.
- id: socket.port
type: int
brief: Client port number of the socket connection.
note: >
When observed from the server side, this SHOULD represent the immediate client peer port.
When observed from the client side, this SHOULD represent the physical client port.
examples: [35555]
requirement_level:
recommended: If different than `client.port`.
11 changes: 6 additions & 5 deletions model/deprecated/network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ groups:
- id: sock.peer.name
type: string
stability: deprecated
brief: Deprecated, use `server.socket.domain` on client spans.
brief: Deprecated, since this was intended to be used for proxies on client spans, use `proxy.address`.
examples: ['/var/my.sock']
- id: sock.peer.addr
type: string
stability: deprecated
brief: >
Deprecated, use `server.socket.address` on client spans and `client.socket.address` on server spans.
Deprecated, if this doesn't represent a proxy address, use `server.ip` on client spans and `client.ip` on server spans.
If this represents a proxy address, use `proxy.address`.
examples: ['192.168.0.1']
- id: sock.peer.port
type: int
stability: deprecated
examples: [65531]
brief: Deprecated, use `server.socket.port` on client spans and `client.socket.port` on server spans.
brief: Deprecated, since this was intended to be used for proxies, use `proxy.port`.
- id: peer.name
type: string
stability: deprecated
Expand All @@ -44,12 +45,12 @@ groups:
- id: sock.host.addr
type: string
stability: deprecated
brief: Deprecated, use `server.socket.address`.
brief: Deprecated, use `server.ip`.
examples: ['/var/my.sock']
- id: sock.host.port
type: int
stability: deprecated
brief: Deprecated, use `server.socket.port`.
brief: Deprecated, use `server.port`.
examples: [8080]
- id: transport
type:
Expand Down
2 changes: 1 addition & 1 deletion model/metrics/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ groups:
- ref: http.response.status_code
- ref: network.protocol.name
- ref: network.protocol.version
- ref: server.socket.address
- ref: server.ip
- ref: error.type
requirement_level:
conditionally_required: If request has ended with an error.
Expand Down
3 changes: 1 addition & 2 deletions model/metrics/rpc-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ groups:
- ref: network.type
- ref: server.address
- ref: server.port
- ref: server.socket.address
- ref: server.socket.port
- ref: server.ip

# RPC Server metrics
- id: metric.rpc.server.duration
Expand Down
20 changes: 20 additions & 0 deletions model/proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
groups:
- id: proxy
prefix: proxy
type: attribute_group
brief: These attributes may be used to describe a proxy (or other intermediary) in a connection-based network interaction.
attributes:
- id: address
type: string
brief: Proxy address - domain name if available without reverse DNS lookup, otherwise IP address or Unix domain socket name.
examples: ['proxy.example.com', '10.1.2.80', '/tmp/my.sock']
- id: port
type: int
brief: Proxy port number.
examples: [65123]
- id: ip
type: string
brief: Proxy IP address.
examples: ['10.1.2.80']
requirement_level:
recommended: If different than `proxy.address`.
28 changes: 6 additions & 22 deletions model/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,22 @@ groups:
note: |
When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent
the server address behind any intermediaries (e.g. proxies) if it's available.
examples: ['example.com']
examples: ['example.com', '10.1.2.80', '/tmp/my.sock']
- id: port
type: int
brief: Server port number
note: >
When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent
the server port behind any intermediaries (e.g. proxies) if it's available.
examples: [80, 8080, 443]
- id: socket.domain
- id: ip
type: string
brief: Immediate server peer's domain name if available without reverse DNS lookup
examples: ['proxy.example.com']
note: Typically observed from the client side, and represents a proxy or other intermediary domain name.
requirement_level:
recommended: If different than `server.address`.
- id: socket.address
type: string
brief: Server address of the socket connection - IP address or Unix domain socket name.
brief: Server IP address.
note: >
When observed from the client side, this SHOULD represent the immediate server peer address.
When observed from the client side, and when communicating through an intermediary, `server.ip` SHOULD represent
the server IP address behind any intermediaries (e.g. proxies) if it's available.
When observed from the server side, this SHOULD represent the physical server address.
When observed from the server side, this SHOULD represent the physical server IP address.
examples: ['10.5.3.2']
requirement_level:
recommended: If different than `server.address`.
- id: socket.port
type: int
brief: Server port number of the socket connection.
note: >
When observed from the client side, this SHOULD represent the immediate server peer port.
When observed from the server side, this SHOULD represent the physical server port.
examples: [16456]
requirement_level:
recommended: If different than `server.port`.
17 changes: 7 additions & 10 deletions model/trace/database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,21 +238,18 @@ groups:
tag: connection-level
requirement_level:
conditionally_required: If using a port other than the default port for this DBMS and if `server.address` is set.
- ref: server.socket.address
tag: connection-level
- ref: server.socket.port
- ref: server.ip
tag: connection-level
- ref: network.transport
tag: connection-level
- ref: network.type
tag: connection-level
- ref: server.socket.domain
requirement_level:
recommended: If different than `server.address` and if `server.socket.address` is set.
constraints:
- any_of:
- 'server.address'
- 'server.socket.address'
- ref: proxy.address
tag: connection-level
- ref: proxy.port
tag: connection-level
- ref: proxy.ip
tag: connection-level

- id: db.mssql
prefix: db.mssql
Expand Down
20 changes: 10 additions & 10 deletions model/trace/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ groups:
note: >
When [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) is absolute URI, `server.port` MUST match
URI port identifier, otherwise it MUST match `Host` header port identifier.
- ref: server.socket.domain
- ref: server.socket.address
- ref: server.socket.port
- ref: server.ip
- ref: proxy.address
- ref: proxy.port
- ref: proxy.ip
- ref: url.full
sampling_relevant: true
requirement_level: required
Expand Down Expand Up @@ -120,12 +121,9 @@ groups:
- Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
if it's sent in absolute-form.
- Port identifier of the `Host` header
- ref: server.socket.address
- ref: server.ip
requirement_level: opt_in
brief: Local socket address. Useful in case of a multi-IP host.
- ref: server.socket.port
requirement_level: opt_in
brief: Local socket port. Useful in case of a multi-port host.
brief: Local socket IP address. Useful in case of a multi-IP host.
- ref: client.address
note: >
The IP address of the original client behind all proxies, if
Expand All @@ -138,8 +136,10 @@ groups:
The port of the original client behind all proxies, if
known (e.g. from [Forwarded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded) or a similar header).
Otherwise, the immediate client peer port.
- ref: client.socket.address
- ref: client.socket.port
- ref: client.ip
- ref: proxy.address
- ref: proxy.port
- ref: proxy.ip
- ref: url.path
requirement_level: required
sampling_relevant: true
Expand Down
12 changes: 6 additions & 6 deletions model/trace/messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,18 @@ groups:
This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from.
requirement_level:
conditionally_required: If available.
- ref: server.socket.address
tag: connection-level
- ref: server.socket.port
- ref: server.ip
tag: connection-level
- ref: network.transport
tag: connection-level
- ref: network.type
tag: connection-level
- ref: server.socket.domain
- ref: proxy.address
tag: connection-level
- ref: proxy.port
tag: connection-level
- ref: proxy.ip
tag: connection-level
requirement_level:
recommended: If different than `server.address` and if `server.socket.address` is set.
- ref: network.protocol.name
examples: ['amqp', 'mqtt']
- ref: network.protocol.version
Expand Down
19 changes: 5 additions & 14 deletions model/trace/rpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ groups:
(e.g., method actually executing the call on the server side,
RPC client stub method on the client side).
examples: "exampleMethod"
- ref: server.socket.address
- ref: server.socket.port
requirement_level:
recommended: If different than `server.port` and if `server.socket.address` is set.
- ref: network.transport
- ref: network.type
- ref: server.address
Expand All @@ -66,19 +62,15 @@ groups:
- ref: server.port
requirement_level:
conditionally_required: See below
constraints:
- any_of:
- server.socket.address
- server.address
- ref: server.ip
- ref: proxy.address
- ref: proxy.port
- ref: proxy.ip

- id: rpc.client
type: span
brief: 'This document defines semantic conventions for remote procedure call client spans.'
extends: rpc
attributes:
- ref: server.socket.domain
requirement_level:
recommended: If different than `server.address` and if `server.socket.address` is set.

- id: rpc.server
prefix: rpc
Expand All @@ -89,8 +81,7 @@ groups:
attributes:
- ref: client.address
- ref: client.port
- ref: client.socket.address
- ref: client.socket.port
- ref: client.ip
- ref: network.transport
- ref: network.type

Expand Down

0 comments on commit ee56e33

Please sign in to comment.