From b6ceb89e7643ded72ea1f1255a5c5560ce373ab8 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Tue, 24 Sep 2024 10:41:01 +0300 Subject: [PATCH 1/4] Add k8s.{pod,node}.network.{io,errors} metrics Signed-off-by: ChrsMark --- .chloggen/add_k8s_network_metrics.yaml | 22 ++++ docs/system/k8s-metrics.md | 136 +++++++++++++++++++++++++ model/k8s/metrics.yaml | 44 ++++++++ 3 files changed, 202 insertions(+) create mode 100755 .chloggen/add_k8s_network_metrics.yaml diff --git a/.chloggen/add_k8s_network_metrics.yaml b/.chloggen/add_k8s_network_metrics.yaml new file mode 100755 index 0000000000..979248f208 --- /dev/null +++ b/.chloggen/add_k8s_network_metrics.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: enhancement + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: k8s + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add k8s.{node,pod}.network.{io,errors} 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: [1427] + +# (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/system/k8s-metrics.md b/docs/system/k8s-metrics.md index bbadff485d..032ec52c79 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -76,6 +76,74 @@ This metric is [recommended][MetricRecommended]. **[1]:** Total memory usage of the Pod + + + + + +### Metric: `k8s.pod.network.io` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.pod.network.io` | Counter | `By` | Pod network IO | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`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. + +| Value | Description | Stability | +|---|---|---| +| `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + + + +### Metric: `k8s.pod.network.errors` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.pod.network.errors` | Counter | `{error}` | Pod network errors | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`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. + +| Value | Description | Stability | +|---|---|---| +| `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + @@ -142,6 +210,74 @@ This metric is [recommended][MetricRecommended]. **[1]:** Total memory usage of the Node + + + + + +### Metric: `k8s.node.network.io` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.node.network.io` | Counter | `By` | Node network IO | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`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. + +| Value | Description | Stability | +|---|---|---| +| `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + + + +### Metric: `k8s.node.network.errors` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.node.network.errors` | Counter | `{error}` | Node network errors | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`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. + +| Value | Description | Stability | +|---|---|---| +| `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index a09cfee780..8f875582f6 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -30,6 +30,28 @@ groups: instrument: gauge unit: "By" + # k8s.pod.network.* metrics + - id: metric.k8s.pod.network.io + type: metric + metric_name: k8s.pod.network.io + stability: experimental + brief: "Pod network IO" + instrument: counter + unit: "By" + attributes: + - ref: system.device + - ref: network.io.direction + - id: metric.k8s.pod.network.errors + type: metric + metric_name: k8s.pod.network.errors + stability: experimental + brief: "Pod network errors" + instrument: counter + unit: "{error}" + attributes: + - ref: system.device + - ref: network.io.direction + # k8s.node.cpu.* metrics - id: metric.k8s.node.cpu.time type: metric @@ -60,3 +82,25 @@ groups: Total memory usage of the Node instrument: gauge unit: "By" + + # k8s.node.network.* metrics + - id: metric.k8s.node.network.io + type: metric + metric_name: k8s.node.network.io + stability: experimental + brief: "Node network IO" + instrument: counter + unit: "By" + attributes: + - ref: system.device + - ref: network.io.direction + - id: metric.k8s.node.network.errors + type: metric + metric_name: k8s.node.network.errors + stability: experimental + brief: "Node network errors" + instrument: counter + unit: "{error}" + attributes: + - ref: system.device + - ref: network.io.direction From 8d0b6c14b1031ce78cadb4376022b8a1a5a6dde8 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 18 Oct 2024 09:58:18 +0300 Subject: [PATCH 2/4] improve description Signed-off-by: ChrsMark --- docs/system/k8s-metrics.md | 12 ++---------- model/k8s/metrics.yaml | 4 ++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 032ec52c79..82e4975a72 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -94,7 +94,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.pod.network.io` | Counter | `By` | Pod network IO | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.pod.network.io` | Counter | `By` | Network bytes for the Pod | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| @@ -108,8 +108,6 @@ This metric is [recommended][MetricRecommended]. | `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -142,8 +140,6 @@ This metric is [recommended][MetricRecommended]. | `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -228,7 +224,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.node.network.io` | Counter | `By` | Node network IO | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.node.network.io` | Counter | `By` | Network bytes for the Node | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| @@ -242,8 +238,6 @@ This metric is [recommended][MetricRecommended]. | `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -276,8 +270,6 @@ This metric is [recommended][MetricRecommended]. | `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index 8f875582f6..d6434db344 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -35,7 +35,7 @@ groups: type: metric metric_name: k8s.pod.network.io stability: experimental - brief: "Pod network IO" + brief: "Network bytes for the Pod" instrument: counter unit: "By" attributes: @@ -88,7 +88,7 @@ groups: type: metric metric_name: k8s.node.network.io stability: experimental - brief: "Node network IO" + brief: "Network bytes for the Node" instrument: counter unit: "By" attributes: From e2b89a6a6df7310f8e21e87941e36357c6488266 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 31 Oct 2024 10:23:27 +0200 Subject: [PATCH 3/4] switch to network.interface.name attribute Signed-off-by: ChrsMark --- docs/system/k8s-metrics.md | 8 ++++---- model/k8s/metrics.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 82e4975a72..12da92f965 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -98,8 +98,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. @@ -130,8 +130,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. @@ -228,8 +228,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. @@ -260,8 +260,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. diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index d6434db344..2e59cef71e 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -39,7 +39,7 @@ groups: instrument: counter unit: "By" attributes: - - ref: system.device + - ref: network.interface.name - ref: network.io.direction - id: metric.k8s.pod.network.errors type: metric @@ -49,7 +49,7 @@ groups: instrument: counter unit: "{error}" attributes: - - ref: system.device + - ref: network.interface.name - ref: network.io.direction # k8s.node.cpu.* metrics @@ -92,7 +92,7 @@ groups: instrument: counter unit: "By" attributes: - - ref: system.device + - ref: network.interface.name - ref: network.io.direction - id: metric.k8s.node.network.errors type: metric @@ -102,5 +102,5 @@ groups: instrument: counter unit: "{error}" attributes: - - ref: system.device + - ref: network.interface.name - ref: network.io.direction From 618fc90312e5f1801912f4e669a6eb598d7fd763 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 21 Nov 2024 11:16:39 +0200 Subject: [PATCH 4/4] re generate Signed-off-by: ChrsMark --- docs/system/k8s-metrics.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 12da92f965..a94eac4050 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -101,6 +101,8 @@ This metric is [recommended][MetricRecommended]. | [`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) | +--- + `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. | Value | Description | Stability | @@ -133,6 +135,8 @@ This metric is [recommended][MetricRecommended]. | [`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) | +--- + `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. | Value | Description | Stability | @@ -231,6 +235,8 @@ This metric is [recommended][MetricRecommended]. | [`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) | +--- + `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. | Value | Description | Stability | @@ -263,6 +269,8 @@ This metric is [recommended][MetricRecommended]. | [`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) | +--- + `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. | Value | Description | Stability |