From ac2123ccf0018434536617e28f6d2ddea3c9ae7e Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 18 Oct 2024 10:54:42 +0300 Subject: [PATCH] Add network.interface.name attribute Signed-off-by: ChrsMark --- .chloggen/add_network_interface.yaml | 22 ++++++++++++++++++++++ docs/attributes-registry/network.md | 1 + docs/system/container-metrics.md | 2 +- docs/system/system-metrics.md | 8 ++++---- model/container/metrics.yaml | 2 +- model/network/registry.yaml | 4 ++++ model/system/metrics.yaml | 8 ++++---- 7 files changed, 37 insertions(+), 10 deletions(-) create mode 100755 .chloggen/add_network_interface.yaml diff --git a/.chloggen/add_network_interface.yaml b/.chloggen/add_network_interface.yaml new file mode 100755 index 0000000000..cb785f2b97 --- /dev/null +++ b/.chloggen/add_network_interface.yaml @@ -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: Introduce `network.interface.name` and use that instead of `system.device` for system and container network metrics + +# 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: [] + +# (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: diff --git a/docs/attributes-registry/network.md b/docs/attributes-registry/network.md index c5984d4ca3..7a7a663f95 100644 --- a/docs/attributes-registry/network.md +++ b/docs/attributes-registry/network.md @@ -21,6 +21,7 @@ These attributes may be used for any network related operation. | `network.carrier.name` | string | The name of the mobile carrier. | `sprint` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `network.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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `network.connection.type` | string | The internet connection type. | `wifi` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `network.interface.name` | string | The network interface name. | `lo`; `eth0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `network.io.direction` | string | The network IO operation direction. | `transmit` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `network.local.address` | string | Local 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) | | `network.local.port` | int | Local port number of the network connection. | `65123` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index a0c7c8599a..ac2df5e984 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -173,8 +173,8 @@ This metric is [opt-in][MetricOptIn]. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`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.io.direction`](/docs/attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`system.device`](/docs/attributes-registry/system.md) | string | The device identifier | `(identifier)` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `network.io.direction` 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. diff --git a/docs/system/system-metrics.md b/docs/system/system-metrics.md index 962087e83b..16d50971cc 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -836,8 +836,8 @@ This metric is [recommended][MetricRecommended]. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`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.io.direction`](/docs/attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`system.device`](/docs/attributes-registry/system.md) | string | The device identifier | `(identifier)` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `network.io.direction` 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. @@ -906,8 +906,8 @@ This metric is [recommended][MetricRecommended]. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`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.io.direction`](/docs/attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`system.device`](/docs/attributes-registry/system.md) | string | The device identifier | `(identifier)` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `network.io.direction` 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. @@ -938,8 +938,8 @@ This metric is [recommended][MetricRecommended]. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`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.io.direction`](/docs/attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`system.device`](/docs/attributes-registry/system.md) | string | The device identifier | `(identifier)` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `network.io.direction` 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. @@ -970,8 +970,8 @@ This metric is [recommended][MetricRecommended]. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`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://osi-model.com/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.device`](/docs/attributes-registry/system.md) | string | The device identifier | `(identifier)` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`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) | **[1]:** The value SHOULD be normalized to lowercase. diff --git a/model/container/metrics.yaml b/model/container/metrics.yaml index 7db120f528..d59d6845fd 100644 --- a/model/container/metrics.yaml +++ b/model/container/metrics.yaml @@ -72,4 +72,4 @@ groups: unit: "By" attributes: - ref: network.io.direction - - ref: system.device + - ref: network.interface.name diff --git a/model/network/registry.yaml b/model/network/registry.yaml index 8470277023..1ace72cf55 100644 --- a/model/network/registry.yaml +++ b/model/network/registry.yaml @@ -232,3 +232,7 @@ groups: stability: experimental brief: "The network IO operation direction." examples: ["transmit"] + - id: network.interface.name + type: string + brief: 'The network interface name.' + examples: [ 'lo', 'eth0' ] diff --git a/model/system/metrics.yaml b/model/system/metrics.yaml index b2b79bf3b7..e1cebb8add 100644 --- a/model/system/metrics.yaml +++ b/model/system/metrics.yaml @@ -291,7 +291,7 @@ groups: - Windows: [`InDiscards`/`OutDiscards`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2) attributes: - - ref: system.device + - ref: network.interface.name - ref: network.io.direction - id: metric.system.network.packets @@ -319,7 +319,7 @@ groups: - Windows: [`InErrors`/`OutErrors`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). attributes: - - ref: system.device + - ref: network.interface.name - ref: network.io.direction - id: metric.system.network.io @@ -330,7 +330,7 @@ groups: instrument: counter unit: "By" attributes: - - ref: system.device + - ref: network.interface.name - ref: network.io.direction - id: metric.system.network.connections @@ -341,7 +341,7 @@ groups: instrument: updowncounter unit: "{connection}" attributes: - - ref: system.device + - ref: network.interface.name - ref: system.network.state - ref: network.transport