From b559797b160221ce9e19069c22d264b7193b1dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20NO=C3=8BL?= Date: Tue, 22 Oct 2024 13:22:59 +0200 Subject: [PATCH] Add system uptime metric --- .chloggen/add-system-uptime.yaml | 17 +++++++++++++++++ docs/system/system-metrics.md | 26 ++++++++++++++++++++++++++ model/system/metrics.yaml | 13 +++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 .chloggen/add-system-uptime.yaml diff --git a/.chloggen/add-system-uptime.yaml b/.chloggen/add-system-uptime.yaml new file mode 100644 index 0000000000..a9c3e49c0d --- /dev/null +++ b/.chloggen/add-system-uptime.yaml @@ -0,0 +1,17 @@ +# 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 system uptime 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: [648] + +# (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 962087e83b..840b261c1e 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -60,6 +60,8 @@ Resource attributes related to a host, SHOULD be reported under the `host.*` nam - [`system.{os}.` - OS Specific System Metrics](#systemos---os-specific-system-metrics) - [Metric: `system.linux.memory.available`](#metric-systemlinuxmemoryavailable) - [Metric: `system.linux.memory.slab.usage`](#metric-systemlinuxmemoryslabusage) +- [Uptime Metric](#uptime-metric) + - [Metric: `system.uptime`](#metric-systemuptime) @@ -1159,3 +1161,27 @@ See also the [Slab allocator](https://blogs.oracle.com/linux/post/understanding- + +## Uptime Metric + +### Metric: `system.uptime` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `system.uptime` | Counter | `s` | The time the system has been running [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** Instrumentations SHOULD use counter with type `double` and measure uptime with the highest precision available. +The actual accuracy would depend on the instrumentation and operating system. + + + + diff --git a/model/system/metrics.yaml b/model/system/metrics.yaml index b2b79bf3b7..6625827358 100644 --- a/model/system/metrics.yaml +++ b/model/system/metrics.yaml @@ -394,3 +394,16 @@ groups: unit: "By" attributes: - ref: linux.memory.slab.state + + # system.uptime metric + - id: metric.system.uptime + type: metric + metric_name: system.uptime + stability: experimental + brief: "The time the system has been running" + note: | + Instrumentations SHOULD use counter with type `double` and measure uptime with the highest precision available. + The actual accuracy would depend on the instrumentation and operating system. + instrument: counter + unit: "s" + attributes: []