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

Replace system.network.state with network.connection.state #1632

Merged
merged 9 commits into from
Dec 17, 2024
22 changes: 22 additions & 0 deletions .chloggen/fix_system_net_state.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: system

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Replace `system.network.state` with `network.connection.state`

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [308]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
41 changes: 31 additions & 10 deletions docs/attributes-registry/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ These attributes may be used for any network related operation.
| <a id="network-carrier-mcc" href="#network-carrier-mcc">`network.carrier.mcc`</a> | string | The mobile carrier country code. | `310` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="network-carrier-mnc" href="#network-carrier-mnc">`network.carrier.mnc`</a> | string | The mobile carrier network code. | `001` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="network-carrier-name" href="#network-carrier-name">`network.carrier.name`</a> | string | The name of the mobile carrier. | `sprint` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="network-connection-state" href="#network-connection-state">`network.connection.state`</a> | string | The state of network connection [1] | `close_wait` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="network-connection-subtype" href="#network-connection-subtype">`network.connection.subtype`</a> | 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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="network-connection-type" href="#network-connection-type">`network.connection.type`</a> | string | The internet connection type. | `wifi` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="network-interface-name" href="#network-interface-name">`network.interface.name`</a> | string | The network interface name. | `lo`; `eth0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand All @@ -27,22 +28,42 @@ These attributes may be used for any network related operation.
| <a id="network-local-port" href="#network-local-port">`network.local.port`</a> | int | Local port number of the network connection. | `65123` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="network-peer-address" href="#network-peer-address">`network.peer.address`</a> | string | Peer address of the network connection - IP address or Unix domain socket name. | `10.1.2.80`; `/tmp/my.sock` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="network-peer-port" href="#network-peer-port">`network.peer.port`</a> | int | Peer port number of the network connection. | `65123` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="network-protocol-name" href="#network-protocol-name">`network.protocol.name`</a> | string | [OSI application layer](https://wikipedia.org/wiki/Application_layer) or non-OSI equivalent. [1] | `amqp`; `http`; `mqtt` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="network-protocol-version" href="#network-protocol-version">`network.protocol.version`</a> | string | The actual version of the protocol used for network communication. [2] | `1.1`; `2` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="network-transport" href="#network-transport">`network.transport`</a> | string | [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [3] | `tcp`; `udp` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="network-type" href="#network-type">`network.type`</a> | string | [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent. [4] | `ipv4`; `ipv6` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="network-protocol-name" href="#network-protocol-name">`network.protocol.name`</a> | string | [OSI application layer](https://wikipedia.org/wiki/Application_layer) or non-OSI equivalent. [2] | `amqp`; `http`; `mqtt` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="network-protocol-version" href="#network-protocol-version">`network.protocol.version`</a> | string | The actual version of the protocol used for network communication. [3] | `1.1`; `2` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="network-transport" href="#network-transport">`network.transport`</a> | string | [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [4] | `tcp`; `udp` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="network-type" href="#network-type">`network.type`</a> | string | [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent. [5] | `ipv4`; `ipv6` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[1] `network.protocol.name`:** The value SHOULD be normalized to lowercase.
**[1] `network.connection.state`:** Connection states are defined as part of the [rfc9293](https://datatracker.ietf.org/doc/html/rfc9293#section-3.3.2)

**[2] `network.protocol.version`:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set.
**[2] `network.protocol.name`:** The value SHOULD be normalized to lowercase.

**[3] `network.transport`:** The value SHOULD be normalized to lowercase.
**[3] `network.protocol.version`:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set.

**[4] `network.transport`:** The value SHOULD be normalized to lowercase.

Consider always setting the transport when setting a port number, since
a port number is ambiguous without knowing the transport. For example
different processes could be listening on TCP port 12345 and UDP port 12345.

**[4] `network.type`:** The value SHOULD be normalized to lowercase.
**[5] `network.type`:** The value SHOULD be normalized to lowercase.

---

`network.connection.state` 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 | Stability |
|---|---|---|
| `close_wait` | close_wait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `closed` | closed | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `closing` | closing | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `established` | established | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `fin_wait_1` | fin_wait_1 | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `fin_wait_2` | fin_wait_2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `last_ack` | last_ack | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `listen` | listen | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `syn_received` | syn_received | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `syn_sent` | syn_sent | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `time_wait` | time_wait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

---

Expand Down Expand Up @@ -152,10 +173,10 @@ These attributes may be used for any network related operation.

| Value | Description | Stability |
|---|---|---|
| `inproc` | In-process communication. [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `inproc` | In-process communication. [6] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `ip_tcp` | ip_tcp | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `ip_udp` | ip_udp | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `other` | Something else (non IP-based). | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `pipe` | Named or anonymous pipe. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[5]:** Signals that there is only in-process communication not using a "real" network protocol in cases where network attributes would normally be expected. Usually all other network attributes can be left out in that case.
**[6]:** Signals that there is only in-process communication not using a "real" network protocol in cases where network attributes would normally be expected. Usually all other network attributes can be left out in that case.
48 changes: 20 additions & 28 deletions docs/attributes-registry/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
- [System CPU Attributes](#system-cpu-attributes)
- [Filesystem Attributes](#filesystem-attributes)
- [System Memory Attributes](#system-memory-attributes)
- [System Network Attributes](#system-network-attributes)
- [System Paging Attributes](#system-paging-attributes)
- [System Process Attributes](#system-process-attributes)
- [Deprecated System Attributes](#deprecated-system-attributes)
Expand Down Expand Up @@ -85,33 +84,6 @@ Describes System Memory attributes
| `shared` | shared | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Removed, report shared memory usage with `metric.system.memory.shared` metric |
| `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

## System Network Attributes

Describes Network attributes

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="system-network-state" href="#system-network-state">`system.network.state`</a> | string | A stateless protocol MUST NOT set this attribute | `close_wait` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

---

`system.network.state` 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 | Stability |
|---|---|---|
| `close` | close | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `close_wait` | close_wait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `closing` | closing | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `delete` | delete | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `established` | established | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `fin_wait_1` | fin_wait_1 | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `fin_wait_2` | fin_wait_2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `last_ack` | last_ack | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `listen` | listen | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `syn_recv` | syn_recv | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `syn_sent` | syn_sent | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `time_wait` | time_wait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

## System Paging Attributes

Describes System Memory Paging attributes
Expand Down Expand Up @@ -175,6 +147,7 @@ Deprecated system attributes.
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="system-cpu-state" href="#system-cpu-state">`system.cpu.state`</a> | string | Deprecated, use `cpu.mode` instead. | `idle`; `interrupt` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `cpu.mode` |
| <a id="system-network-state" href="#system-network-state">`system.network.state`</a> | string | Deprecated, use `network.connection.state` instead. | `close_wait` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Removed, report network connection state with `network.connection.state` attribute |
| <a id="system-processes-status" href="#system-processes-status">`system.processes.status`</a> | string | Deprecated, use `system.process.status` instead. | `running` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `system.process.status`. |

---
Expand All @@ -193,6 +166,25 @@ Deprecated system attributes.

---

`system.network.state` 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 | Stability |
|---|---|---|
| `close` | close | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `close_wait` | close_wait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `closing` | closing | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `delete` | delete | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `established` | established | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `fin_wait_1` | fin_wait_1 | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `fin_wait_2` | fin_wait_2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `last_ack` | last_ack | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `listen` | listen | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `syn_recv` | syn_recv | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `syn_sent` | syn_sent | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `time_wait` | time_wait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

---

`system.processes.status` 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 | Stability |
Expand Down
39 changes: 20 additions & 19 deletions docs/system/system-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1041,47 +1041,48 @@ This metric is [recommended][MetricRecommended].

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`network.connection.state`](/docs/attributes-registry/network.md) | string | The state of network connection [1] | `close_wait` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`network.interface.name`](/docs/attributes-registry/network.md) | string | The network interface name. | `lo`; `eth0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`network.transport`](/docs/attributes-registry/network.md) | string | [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [1] | `tcp`; `udp` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`system.network.state`](/docs/attributes-registry/system.md) | string | A stateless protocol MUST NOT set this attribute | `close_wait` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`network.transport`](/docs/attributes-registry/network.md) | string | [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [2] | `tcp`; `udp` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[1] `network.transport`:** The value SHOULD be normalized to lowercase.
**[1] `network.connection.state`:** Connection states are defined as part of the [rfc9293](https://datatracker.ietf.org/doc/html/rfc9293#section-3.3.2)

**[2] `network.transport`:** The value SHOULD be normalized to lowercase.

Consider always setting the transport when setting a port number, since
a port number is ambiguous without knowing the transport. For example
different processes could be listening on TCP port 12345 and UDP port 12345.

---

`network.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 | Stability |
|---|---|---|
| `pipe` | Named or anonymous pipe. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `quic` | QUIC | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `tcp` | TCP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

---

`system.network.state` 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.
`network.connection.state` 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 | Stability |
|---|---|---|
| `close` | close | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `close_wait` | close_wait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `closed` | closed | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `closing` | closing | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `delete` | delete | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `established` | established | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `fin_wait_1` | fin_wait_1 | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `fin_wait_2` | fin_wait_2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `last_ack` | last_ack | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `listen` | listen | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `syn_recv` | syn_recv | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `syn_received` | syn_received | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `syn_sent` | syn_sent | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `time_wait` | time_wait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

---

`network.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 | Stability |
|---|---|---|
| `pipe` | Named or anonymous pipe. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `quic` | QUIC | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `tcp` | TCP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down
Loading
Loading