From c60ecbc347779ccc8b5c348940597943da44ab15 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 18 Oct 2024 10:54:42 +0300 Subject: [PATCH 1/4] 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..0225bf1d6f --- /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: [1492] + +# (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 82256c0345..d3dec31057 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 96ec1475e7..3ec982385b 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -863,8 +863,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. @@ -933,8 +933,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. @@ -965,8 +965,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. @@ -997,8 +997,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 2f954e41aa..2aa2429d32 100644 --- a/model/system/metrics.yaml +++ b/model/system/metrics.yaml @@ -303,7 +303,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 @@ -331,7 +331,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 @@ -342,7 +342,7 @@ groups: instrument: counter unit: "By" attributes: - - ref: system.device + - ref: network.interface.name - ref: network.io.direction - id: metric.system.network.connections @@ -353,7 +353,7 @@ groups: instrument: updowncounter unit: "{connection}" attributes: - - ref: system.device + - ref: network.interface.name - ref: system.network.state - ref: network.transport From 137038b09d0dfba592877c463ce618df46a81e42 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Mon, 21 Oct 2024 17:45:23 +0300 Subject: [PATCH 2/4] add entry in schema next Signed-off-by: ChrsMark --- schema-next.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/schema-next.yaml b/schema-next.yaml index 7a0a8f578a..a3faafd93f 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -8,6 +8,18 @@ versions: - rename_attributes: attribute_map: process.executable.build_id.profiling: process.executable.build_id.htlhash + metrics: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/1492 + - rename_attributes: + attribute_map: + system.device: network.interface.name + apply_to_metrics: + - container.network.io + - system.network.dropped + - system.network.errors + - system.network.io + - system.network.connections 1.28.0: metrics: changes: From 57b6d230f51c83ba65a7ac3cbc5c6f550363c843 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Mon, 21 Oct 2024 17:45:42 +0300 Subject: [PATCH 3/4] add deprecated sections Signed-off-by: ChrsMark --- .../container/deprecated/registry-deprecated.yaml | 14 ++++++++++++++ model/system/deprecated/registry-deprecated.yaml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/model/container/deprecated/registry-deprecated.yaml b/model/container/deprecated/registry-deprecated.yaml index b99b0f43b3..d75f322d56 100644 --- a/model/container/deprecated/registry-deprecated.yaml +++ b/model/container/deprecated/registry-deprecated.yaml @@ -29,3 +29,17 @@ groups: stability: experimental deprecated: 'Replaced by `cpu.mode`' examples: [ "user", "kernel" ] + + - id: registry.container.metrics.deprecated + type: attribute_group + display_name: Deprecated Container Metrics + brief: > + "Describes deprecated container metrics attributes." + stability: experimental + attributes: + - id: system.device + type: string + stability: experimental + brief: "Deprecated, use `network.interface.name` instead." + deprecated: "Replaced by `network.interface.name`." + examples: [ "(identifier)" ] diff --git a/model/system/deprecated/registry-deprecated.yaml b/model/system/deprecated/registry-deprecated.yaml index 70ea9583ae..01880caf74 100644 --- a/model/system/deprecated/registry-deprecated.yaml +++ b/model/system/deprecated/registry-deprecated.yaml @@ -51,3 +51,17 @@ groups: stability: experimental deprecated: 'Replaced by `cpu.mode`' examples: [ "idle", "interrupt" ] + + - id: registry.system.metrics.deprecated + type: attribute_group + display_name: Deprecated System Metrics + brief: > + "Describes deprecated system metrics attributes." + stability: experimental + attributes: + - id: system.device + type: string + stability: experimental + brief: "Deprecated, use `network.interface.name` instead." + deprecated: "Replaced by `network.interface.name`." + examples: [ "(identifier)" ] From 14ee552f64b51df4641a763284d7968a666b0db9 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 25 Oct 2024 10:48:58 +0300 Subject: [PATCH 4/4] remove deprecated section Signed-off-by: ChrsMark --- .../container/deprecated/registry-deprecated.yaml | 14 -------------- model/system/deprecated/registry-deprecated.yaml | 14 -------------- 2 files changed, 28 deletions(-) diff --git a/model/container/deprecated/registry-deprecated.yaml b/model/container/deprecated/registry-deprecated.yaml index d75f322d56..b99b0f43b3 100644 --- a/model/container/deprecated/registry-deprecated.yaml +++ b/model/container/deprecated/registry-deprecated.yaml @@ -29,17 +29,3 @@ groups: stability: experimental deprecated: 'Replaced by `cpu.mode`' examples: [ "user", "kernel" ] - - - id: registry.container.metrics.deprecated - type: attribute_group - display_name: Deprecated Container Metrics - brief: > - "Describes deprecated container metrics attributes." - stability: experimental - attributes: - - id: system.device - type: string - stability: experimental - brief: "Deprecated, use `network.interface.name` instead." - deprecated: "Replaced by `network.interface.name`." - examples: [ "(identifier)" ] diff --git a/model/system/deprecated/registry-deprecated.yaml b/model/system/deprecated/registry-deprecated.yaml index 01880caf74..70ea9583ae 100644 --- a/model/system/deprecated/registry-deprecated.yaml +++ b/model/system/deprecated/registry-deprecated.yaml @@ -51,17 +51,3 @@ groups: stability: experimental deprecated: 'Replaced by `cpu.mode`' examples: [ "idle", "interrupt" ] - - - id: registry.system.metrics.deprecated - type: attribute_group - display_name: Deprecated System Metrics - brief: > - "Describes deprecated system metrics attributes." - stability: experimental - attributes: - - id: system.device - type: string - stability: experimental - brief: "Deprecated, use `network.interface.name` instead." - deprecated: "Replaced by `network.interface.name`." - examples: [ "(identifier)" ]