From 1dc64eef5215dec963efcb66dfe91360e59ab532 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Tue, 3 Sep 2024 16:14:59 +0200 Subject: [PATCH 1/4] Add the system.filesystem.limit metric --- .chloggen/add_filesystem_limit.yaml | 22 +++++++++++ docs/system/system-metrics.md | 61 ++++++++++++++++++++++++++++- model/metrics/system-metrics.yaml | 16 ++++++++ 3 files changed, 98 insertions(+), 1 deletion(-) create mode 100755 .chloggen/add_filesystem_limit.yaml diff --git a/.chloggen/add_filesystem_limit.yaml b/.chloggen/add_filesystem_limit.yaml new file mode 100755 index 0000000000..36228d7da0 --- /dev/null +++ b/.chloggen/add_filesystem_limit.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: system + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add the `system.filesystem.limit` metric + +# 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: [127] + +# (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/system-metrics.md b/docs/system/system-metrics.md index c91f822e31..c0a2908e27 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -47,6 +47,7 @@ Resource attributes related to a host, SHOULD be reported under the `host.*` nam - [Filesystem Metrics](#filesystem-metrics) - [Metric: `system.filesystem.usage`](#metric-systemfilesystemusage) - [Metric: `system.filesystem.utilization`](#metric-systemfilesystemutilization) + - [Metric: `system.filesystem.limit`](#metric-systemfilesystemlimit) - [Network Metrics](#network-metrics) - [Metric: `system.network.dropped`](#metric-systemnetworkdropped) - [Metric: `system.network.packets`](#metric-systemnetworkpackets) @@ -977,7 +978,12 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `system.filesystem.usage` | UpDownCounter | `By` | | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `system.filesystem.usage` | UpDownCounter | `By` | [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + +**[1]:** The sum over all `system.filesystem.state` values SHOULD equal the total storage +capacity of the filesystem, that is `system.filesystem.limit`. + @@ -1085,6 +1091,59 @@ This metric is [recommended][MetricRecommended]. + + + + + +### Metric: `system.filesystem.limit` + +This metric is [opt-in][MetricOptIn]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `system.filesystem.limit` | UpDownCounter | `By` | The total storage capacity of the filesystem | ![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 | +|---|---|---|---|---|---| +| [`system.device`](/docs/attributes-registry/system.md) | string | The device identifier | `(identifier)` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`system.filesystem.mode`](/docs/attributes-registry/system.md) | string | The filesystem mode | `rw, ro` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`system.filesystem.mountpoint`](/docs/attributes-registry/system.md) | string | The filesystem mount path | `/mnt/data` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`system.filesystem.type`](/docs/attributes-registry/system.md) | string | The filesystem type | `ext4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +`system.filesystem.type` 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 | +|---|---|---| +| `exfat` | exfat | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `ext4` | ext4 | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `fat32` | fat32 | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `hfsplus` | hfsplus | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `ntfs` | ntfs | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `refs` | refs | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + diff --git a/model/metrics/system-metrics.yaml b/model/metrics/system-metrics.yaml index 33b94a3ff0..11374d26a6 100644 --- a/model/metrics/system-metrics.yaml +++ b/model/metrics/system-metrics.yaml @@ -225,6 +225,9 @@ groups: metric_name: system.filesystem.usage stability: experimental brief: "" + note: | + The sum over all `system.filesystem.state` values SHOULD equal the total storage + capacity of the filesystem, that is `system.filesystem.limit`. instrument: updowncounter unit: "By" attributes: @@ -248,6 +251,19 @@ groups: - ref: system.filesystem.mode - ref: system.filesystem.mountpoint + - id: metric.system.filesystem.limit + type: metric + metric_name: system.filesystem.limit + stability: experimental + brief: "The total storage capacity of the filesystem" + instrument: updowncounter + unit: "By" + attributes: + - ref: system.device + - ref: system.filesystem.type + - ref: system.filesystem.mode + - ref: system.filesystem.mountpoint + # system.network.* metrics - id: metric.system.network.dropped type: metric From 536fbd8dd01542c0d9c619acab2ecc05de16c54d Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Thu, 12 Sep 2024 11:52:50 +0200 Subject: [PATCH 2/4] docs: add brief for system.filesystem.usage --- docs/system/system-metrics.md | 2 +- model/metrics/system-metrics.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/system/system-metrics.md b/docs/system/system-metrics.md index c0a2908e27..26500bc40e 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -978,7 +978,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `system.filesystem.usage` | UpDownCounter | `By` | [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `system.filesystem.usage` | UpDownCounter | `By` | Reports a filesystem's space usage across different states. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The sum over all `system.filesystem.state` values SHOULD equal the total storage diff --git a/model/metrics/system-metrics.yaml b/model/metrics/system-metrics.yaml index 11374d26a6..43d94ccc0b 100644 --- a/model/metrics/system-metrics.yaml +++ b/model/metrics/system-metrics.yaml @@ -224,7 +224,7 @@ groups: type: metric metric_name: system.filesystem.usage stability: experimental - brief: "" + brief: "Reports a filesystem's space usage across different states." note: | The sum over all `system.filesystem.state` values SHOULD equal the total storage capacity of the filesystem, that is `system.filesystem.limit`. From f9deb24349f9a09a3809adf3e116e5ff25544106 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Fri, 13 Sep 2024 18:43:50 +0200 Subject: [PATCH 3/4] add system.device attribute brief for filesystem metrics --- docs/system/system-metrics.md | 6 +++--- model/metrics/system-metrics.yaml | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/system/system-metrics.md b/docs/system/system-metrics.md index 26500bc40e..82d0addcab 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -1000,7 +1000,7 @@ capacity of the filesystem, that is `system.filesystem.limit`. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`system.device`](/docs/attributes-registry/system.md) | string | The device identifier | `(identifier)` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`system.device`](/docs/attributes-registry/system.md) | string | Identifier for the device where the filesystem resides. | `/dev/sda`; `\network-drive` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.filesystem.mode`](/docs/attributes-registry/system.md) | string | The filesystem mode | `rw, ro` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.filesystem.mountpoint`](/docs/attributes-registry/system.md) | string | The filesystem mount path | `/mnt/data` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.filesystem.state`](/docs/attributes-registry/system.md) | string | The filesystem state | `used` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -1063,7 +1063,7 @@ This metric is [recommended][MetricRecommended]. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`system.device`](/docs/attributes-registry/system.md) | string | The device identifier | `(identifier)` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`system.device`](/docs/attributes-registry/system.md) | string | Identifier for the device where the filesystem resides. | `/dev/sda`; `\network-drive` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.filesystem.mode`](/docs/attributes-registry/system.md) | string | The filesystem mode | `rw, ro` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.filesystem.mountpoint`](/docs/attributes-registry/system.md) | string | The filesystem mount path | `/mnt/data` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.filesystem.state`](/docs/attributes-registry/system.md) | string | The filesystem state | `used` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -1126,7 +1126,7 @@ This metric is [opt-in][MetricOptIn]. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`system.device`](/docs/attributes-registry/system.md) | string | The device identifier | `(identifier)` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`system.device`](/docs/attributes-registry/system.md) | string | Identifier for the device where the filesystem resides. | `/dev/sda`; `\network-drive` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.filesystem.mode`](/docs/attributes-registry/system.md) | string | The filesystem mode | `rw, ro` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.filesystem.mountpoint`](/docs/attributes-registry/system.md) | string | The filesystem mount path | `/mnt/data` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.filesystem.type`](/docs/attributes-registry/system.md) | string | The filesystem type | `ext4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/model/metrics/system-metrics.yaml b/model/metrics/system-metrics.yaml index 43d94ccc0b..c0374f4f79 100644 --- a/model/metrics/system-metrics.yaml +++ b/model/metrics/system-metrics.yaml @@ -232,6 +232,8 @@ groups: unit: "By" attributes: - ref: system.device + brief: Identifier for the device where the filesystem resides. + examples: ["/dev/sda", "\\network-drive"] - ref: system.filesystem.state - ref: system.filesystem.type - ref: system.filesystem.mode @@ -246,6 +248,8 @@ groups: unit: "1" attributes: - ref: system.device + brief: Identifier for the device where the filesystem resides. + examples: ["/dev/sda", "\\network-drive"] - ref: system.filesystem.state - ref: system.filesystem.type - ref: system.filesystem.mode @@ -260,6 +264,8 @@ groups: unit: "By" attributes: - ref: system.device + brief: Identifier for the device where the filesystem resides. + examples: ["/dev/sda", "\\network-drive"] - ref: system.filesystem.type - ref: system.filesystem.mode - ref: system.filesystem.mountpoint From db0fd2242196e91258909c7bf958cdd3f44ad7d6 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Fri, 13 Sep 2024 18:54:01 +0200 Subject: [PATCH 4/4] fix: filesystem usage reference --- docs/system/system-metrics.md | 4 ++-- model/metrics/system-metrics.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/system/system-metrics.md b/docs/system/system-metrics.md index 82d0addcab..8cd6cf5cc9 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -981,8 +981,8 @@ This metric is [recommended][MetricRecommended]. | `system.filesystem.usage` | UpDownCounter | `By` | Reports a filesystem's space usage across different states. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1]:** The sum over all `system.filesystem.state` values SHOULD equal the total storage -capacity of the filesystem, that is `system.filesystem.limit`. +**[1]:** The sum of all `system.filesystem.usage` values over the different `system.filesystem.state` attributes +SHOULD equal the total storage capacity of the filesystem, that is `system.filesystem.limit`. diff --git a/model/metrics/system-metrics.yaml b/model/metrics/system-metrics.yaml index c0374f4f79..583e421def 100644 --- a/model/metrics/system-metrics.yaml +++ b/model/metrics/system-metrics.yaml @@ -226,8 +226,8 @@ groups: stability: experimental brief: "Reports a filesystem's space usage across different states." note: | - The sum over all `system.filesystem.state` values SHOULD equal the total storage - capacity of the filesystem, that is `system.filesystem.limit`. + The sum of all `system.filesystem.usage` values over the different `system.filesystem.state` attributes + SHOULD equal the total storage capacity of the filesystem, that is `system.filesystem.limit`. instrument: updowncounter unit: "By" attributes: