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

BREAKING: Rename remaining network attributes from net.* to network.* and align definitions with ECS #3426

Merged
merged 25 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ release.
([#3390](https://github.com/open-telemetry/opentelemetry-specification/pull/3390))
- BREAKING: Remove `messaging.consumer.id`, make `messaging.client_id` generic
([#3336](https://github.com/open-telemetry/opentelemetry-specification/pull/3336))
- BREAKING: Introduce `network.transport` defined as
[OSI Transport Layer](https://osi-model.com/transport-layer/) or
[Inter-process Communication method](https://en.wikipedia.org/wiki/Inter-process_communication).
Introduce `network.type` defined as [OSI Network Layer](https://osi-model.com/network-layer/)
or non-OSI equivalent. Remove `net.transport` and `net.sock.family`.
Rename `net.protocol.*` to `network.protocol.*`,
`net.host.connection.*` to `network.connection.*`, and
`net.host.carrier.*` to `network.carrier.*`.
([#3426](https://github.com/open-telemetry/opentelemetry-specification/pull/3426))

### Compatibility

Expand Down
11 changes: 11 additions & 0 deletions schemas/1.21.0
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ versions:
attribute_map:
messaging.kafka.client_id: messaging.client_id
messaging.rocketmq.client_id: messaging.client_id
# https://github.com/open-telemetry/opentelemetry-specification/pull/3426
- rename_attributes:
attribute_map:
net.protocol.name: network.protocol.name
net.protocol.version: network.protocol.version
net.host.connection.type: network.connection.type
net.host.connection.subtype: network.connection.subtype
net.host.carrier.name: network.carrier.name
net.host.carrier.mcc: network.carrier.mcc
net.host.carrier.mnc: network.carrier.mnc
net.host.carrier.icc: network.carrier.icc
1.20.0:
spans:
changes:
Expand Down
4 changes: 2 additions & 2 deletions semantic_conventions/http-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ groups:
conditionally_required: If and only if one was received/sent.
brief: '[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).'
examples: [200]
- ref: net.protocol.name
- ref: network.protocol.name
examples: ['http', 'spdy']
requirement_level:
recommended: if not default (`http`).
- ref: net.protocol.version
- ref: network.protocol.version
examples: ['1.0', '1.1', '2.0']

- id: attributes.http.client
Expand Down
24 changes: 12 additions & 12 deletions semantic_conventions/metrics/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ groups:
# todo (lmolkova) build tools don't populate grandparent attributes
- ref: http.method
- ref: http.status_code
- ref: net.protocol.name
- ref: net.protocol.version
- ref: network.protocol.name
- ref: network.protocol.version

- id: metric.http.server.active_requests
type: metric
Expand Down Expand Up @@ -62,8 +62,8 @@ groups:
# todo (lmolkova) build tools don't populate grandparent attributes
- ref: http.method
- ref: http.status_code
- ref: net.protocol.name
- ref: net.protocol.version
- ref: network.protocol.name
- ref: network.protocol.version

- id: metric.http.server.response.size
type: metric
Expand All @@ -76,8 +76,8 @@ groups:
attributes:
- ref: http.method
- ref: http.status_code
- ref: net.protocol.name
- ref: net.protocol.version
- ref: network.protocol.name
- ref: network.protocol.version

- id: metric.http.client.duration
type: metric
Expand All @@ -89,8 +89,8 @@ groups:
attributes:
- ref: http.method
- ref: http.status_code
- ref: net.protocol.name
- ref: net.protocol.version
- ref: network.protocol.name
- ref: network.protocol.version
- ref: net.sock.peer.addr

- id: metric.http.client.request.size
Expand All @@ -104,8 +104,8 @@ groups:
attributes:
- ref: http.method
- ref: http.status_code
- ref: net.protocol.name
- ref: net.protocol.version
- ref: network.protocol.name
- ref: network.protocol.version
- ref: net.sock.peer.addr

- id: metric.http.client.response.size
Expand All @@ -119,6 +119,6 @@ groups:
attributes:
- ref: http.method
- ref: http.status_code
- ref: net.protocol.name
- ref: net.protocol.version
- ref: network.protocol.name
- ref: network.protocol.version
- ref: net.sock.peer.addr
8 changes: 3 additions & 5 deletions semantic_conventions/trace/database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,13 @@ groups:
tag: connection-level
- ref: net.sock.peer.port
tag: connection-level
- ref: net.sock.family
- ref: network.transport
tag: connection-level
- ref: network.type
tag: connection-level
- ref: net.sock.peer.name
requirement_level:
recommended: If different than `net.peer.name` and if `net.sock.peer.addr` is set.
- ref: net.transport
tag: connection-level
requirement_level:
conditionally_required: If database type is in-process (`"inproc"`), recommended for other database types.
constraints:
- any_of:
- 'net.peer.name'
Expand Down
137 changes: 92 additions & 45 deletions semantic_conventions/trace/general.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
groups:
- id: network-core
- id: network-deprecated
prefix: net
type: attribute_group
brief: >
These attributes may be used for any network related operation.
These attributes may be used for any network related operation.
attributes:
- id: transport
type:
Expand All @@ -26,95 +26,142 @@ groups:
- id: other
value: "other"
brief: 'Something else (non IP-based).'
brief: >
Transport protocol used. See note below.
stability: deprecated
brief: Deprecated, use `network.transport`.
- id: protocol.name
type: string
brief: 'Application layer protocol used. The value SHOULD be normalized to lowercase.'
stability: deprecated
brief: Deprecated, use `network.protocol.name`.
examples: ['amqp', 'http', 'mqtt']
- id: protocol.version
type: string
stability: deprecated
brief: Deprecated, use `network.protocol.version`.
examples: '3.1.1'
- id: sock.family
type:
allow_custom_values: true
members:
- id: inet
value: 'inet'
brief: "IPv4 address"
- id: inet6
value: 'inet6'
brief: "IPv6 address"
- id: unix
value: 'unix'
brief: "Unix domain socket path"
stability: deprecated
brief: Deprecated, use `network.transport` and `network.type`.

- id: network-core
# TODO (trask) bring back prefix after https://github.com/open-telemetry/opentelemetry-specification/pull/3402
type: attribute_group
brief: >
These attributes may be used for any network related operation.
attributes:
- id: network.transport
type:
allow_custom_values: true
members:
- id: tcp
value: 'tcp'
brief: "TCP"
- id: udp
value: 'udp'
brief: "UDP"
- id: pipe
value: "pipe"
brief: 'Named or anonymous pipe. See note below.'
- id: unix
value: 'unix'
brief: "Unix domain socket"
brief: >
[OSI Transport Layer](https://osi-model.com/transport-layer/) or
[Inter-process Communication method](https://en.wikipedia.org/wiki/Inter-process_communication).
The value SHOULD be normalized to lowercase.
examples: ['tcp', 'udp']
- id: network.type
type:
allow_custom_values: true
members:
- id: ipv4
value: 'ipv4'
brief: "IPv4"
- id: ipv6
value: 'ipv6'
brief: "IPv6"
brief: >
[OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent.
The value SHOULD be normalized to lowercase.
examples: ['ipv4', 'ipv6']
trask marked this conversation as resolved.
Show resolved Hide resolved
- id: network.protocol.name
trask marked this conversation as resolved.
Show resolved Hide resolved
type: string
brief: >
[OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent.
The value SHOULD be normalized to lowercase.
examples: ['amqp', 'http', 'mqtt']
- id: network.protocol.version
type: string
brief: 'Version of the application layer protocol used. See note below.'
examples: '3.1.1'
note: >
`net.protocol.version` refers to the version of the protocol used and might be
`network.protocol.version` refers to the version of the protocol used and might be
different from the protocol client's version. If the HTTP client used has a version
of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`.
- id: sock.peer.name
- id: net.sock.peer.name
type: string
brief: Remote socket peer name.
requirement_level:
recommended: If available and different from `net.peer.name` and if `net.sock.peer.addr` is set.
examples: proxy.example.com
- id: sock.peer.addr
- id: net.sock.peer.addr
type: string
brief: >
Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication,
[etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
examples: ['127.0.0.1', '/tmp/mysql.sock' ]
- id: sock.peer.port
- id: net.sock.peer.port
type: int
brief: Remote socket peer port.
requirement_level:
recommended: If defined for the address family and if different than `net.peer.port` and if `net.sock.peer.addr` is set.
examples: 16456
- id: sock.family
type:
allow_custom_values: true
members:
- id: inet
value: 'inet'
brief: "IPv4 address"
- id: inet6
value: 'inet6'
brief: "IPv6 address"
- id: unix
value: 'unix'
brief: "Unix domain socket path"
requirement_level:
conditionally_required: >
If different than `inet` and if any of `net.sock.peer.addr` or `net.sock.host.addr` are set.
Consumers of telemetry SHOULD accept both IPv4 and IPv6 formats for the address in `net.sock.peer.addr`
if `net.sock.family` is not set. This is to support instrumentations that follow previous versions
of this document.
brief: >
Protocol [address family](https://man7.org/linux/man-pages/man7/address_families.7.html) which is used for communication.
examples: ['inet6', 'bluetooth']
- id: peer.name
- id: net.peer.name
type: string
brief: 'Logical remote hostname, see note below.'
examples: 'example.com'
note: >
`net.peer.name` SHOULD NOT be set if capturing it would require an extra DNS lookup.
- id: peer.port
- id: net.peer.port
type: int
brief: 'Logical remote port number'
examples: [80, 8080, 443]
- id: host.name
- id: net.host.name
type: string
brief: 'Logical local hostname or similar, see note below.'
examples: 'localhost'
- id: host.port
- id: net.host.port
type: int
brief: 'Logical local port number, preferably the one that the peer used to connect'
examples: 8080
- id: sock.host.addr
- id: net.sock.host.addr
type: string
brief: Local socket address. Useful in case of a multi-IP host.
examples: '192.168.0.1'
- id: sock.host.port
- id: net.sock.host.port
type: int
brief: 'Local socket port number.'
requirement_level:
conditionally_required: If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set. In other cases, it is still recommended to set this.
examples: 35555
- id: network-connection-and-carrier
prefix: net
prefix: network
type: attribute_group
brief: >
These attributes may be used for any network related operation.
attributes:
- id: host.connection.type
- id: connection.type
type:
allow_custom_values: true
members:
Expand All @@ -128,9 +175,9 @@ groups:
value: "unavailable"
- id: unknown
value: "unknown"
brief: 'The internet connection type currently being used by the host.'
brief: 'The internet connection type.'
examples: 'wifi'
- id: host.connection.subtype
- id: connection.subtype
type:
allow_custom_values: true
members:
Expand Down Expand Up @@ -199,19 +246,19 @@ groups:
value: "lte_ca"
brief: '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.'
examples: 'LTE'
- id: host.carrier.name
- id: carrier.name
type: string
brief: "The name of the mobile carrier."
examples: "sprint"
- id: host.carrier.mcc
- id: carrier.mcc
type: string
brief: "The mobile carrier country code."
examples: "310"
- id: host.carrier.mnc
- id: carrier.mnc
type: string
brief: "The mobile carrier network code."
examples: "001"
- id: host.carrier.icc
- id: carrier.icc
type: string
brief: "The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network."
examples: "DE"
Expand Down
6 changes: 4 additions & 2 deletions semantic_conventions/trace/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ groups:
- ref: net.sock.peer.addr
- ref: net.sock.peer.port
- ref: net.sock.peer.name
- ref: net.sock.family
examples: ['inet', 'inet6']
- ref: network.transport
trask marked this conversation as resolved.
Show resolved Hide resolved
requirement_level:
conditionally_required: If not default (`tcp` for `HTTP/1.1` and `HTTP/2`, `udp` for `HTTP/3`).
- ref: network.type
- ref: user_agent.original

- id: trace.http.client
Expand Down
8 changes: 5 additions & 3 deletions semantic_conventions/trace/messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,17 @@ groups:
tag: connection-level
- ref: net.sock.peer.port
tag: connection-level
- ref: net.sock.family
- ref: network.transport
tag: connection-level
- ref: network.type
tag: connection-level
- ref: net.sock.peer.name
tag: connection-level
requirement_level:
recommended: If different than `net.peer.name` and if `net.sock.peer.addr` is set.
- ref: net.protocol.name
- ref: network.protocol.name
examples: ['amqp', 'mqtt']
- ref: net.protocol.version
- ref: network.protocol.version

- id: messaging.producer
prefix: messaging
Expand Down
Loading