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 15 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.host.connection.*`, and
`net.host.carrier.*` to `network.host.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.host.connection.type
net.host.connection.subtype: network.host.connection.subtype
net.host.carrier.name: network.host.carrier.name
net.host.carrier.mcc: network.host.carrier.mcc
net.host.carrier.mnc: network.host.carrier.mnc
net.host.carrier.icc: network.host.carrier.icc
trask marked this conversation as resolved.
Show resolved Hide resolved
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
123 changes: 85 additions & 38 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,90 +26,137 @@ 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.
Expand Down
4 changes: 2 additions & 2 deletions semantic_conventions/trace/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ 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
- 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
11 changes: 4 additions & 7 deletions semantic_conventions/trace/rpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ groups:
- ref: net.sock.peer.port
requirement_level:
recommended: If different than `net.peer.port` and if `net.sock.peer.addr` is set.
- ref: net.sock.family
requirement_level:
conditionally_required: If and only if `net.sock.peer.addr` is set.
- ref: network.transport
- ref: network.type
- ref: net.sock.peer.name
requirement_level:
recommended: If different than `net.peer.name` and if `net.sock.peer.addr` is set.
Expand All @@ -70,9 +69,6 @@ groups:
- ref: net.peer.port
requirement_level:
conditionally_required: See below
- ref: net.transport
requirement_level:
conditionally_required: See below
constraints:
- any_of:
- net.sock.peer.addr
Expand All @@ -88,7 +84,8 @@ groups:
- ref: net.host.name
- ref: net.sock.host.addr
- ref: net.sock.host.port
- ref: net.sock.family
- ref: network.transport
trask marked this conversation as resolved.
Show resolved Hide resolved
- ref: network.type

- id: rpc.grpc
prefix: rpc.grpc
Expand Down
2 changes: 1 addition & 1 deletion specification/common/attribute-requirement-level.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ For example, Metric attributes that may have high cardinality can only be define

A semantic convention that refers to an attribute from another semantic convention MAY modify the requirement level within its own scope. Otherwise, requirement level from the referred semantic convention applies.

For example, [Database semantic convention](../trace/semantic_conventions/database.md) references `net.transport` attribute defined in [General attributes](../trace/semantic_conventions/span-general.md) with `Conditionally Required` level on it.
For example, [Database semantic convention](../trace/semantic_conventions/database.md) references `network.transport` attribute defined in [General attributes](../trace/semantic_conventions/span-general.md) with `Conditionally Required` level on it.

## Required

Expand Down
Loading