From 6da7369d013ab6db1f0e68084767713fd05b7a2c Mon Sep 17 00:00:00 2001 From: "Kevin N." <6809505+kevinnoel-be@users.noreply.github.com> Date: Fri, 25 Oct 2024 18:50:24 +0200 Subject: [PATCH] Add system uptime metric (#1507) --- .chloggen/add-system-uptime.yaml | 17 +++++++++++++++++ docs/system/system-metrics.md | 27 +++++++++++++++++++++++++++ model/system/metrics.yaml | 12 ++++++++++++ 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..96ec1475e7 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -21,6 +21,8 @@ Resource attributes related to a host, SHOULD be reported under the `host.*` nam +- [General Metrics](#general-metrics) + - [Metric: `system.uptime`](#metric-systemuptime) - [Processor Metrics](#processor-metrics) - [Metric: `system.cpu.time`](#metric-systemcputime) - [Metric: `system.cpu.utilization`](#metric-systemcpuutilization) @@ -73,6 +75,31 @@ Resource attributes related to a host, SHOULD be reported under the `host.*` nam > * SHOULD introduce a control mechanism to allow users to opt-in to the new > conventions once the migration plan is finalized. +## General Metrics + +### Metric: `system.uptime` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `system.uptime` | Gauge | `s` | The time the system has been running [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** Instrumentations SHOULD use a gauge with type `double` and measure uptime in seconds as a floating point number with the highest precision available. +The actual accuracy would depend on the instrumentation and operating system. + + + + + + ## Processor Metrics **Description:** System level processor metrics captured under the namespace `system.cpu`. diff --git a/model/system/metrics.yaml b/model/system/metrics.yaml index b2b79bf3b7..2f954e41aa 100644 --- a/model/system/metrics.yaml +++ b/model/system/metrics.yaml @@ -1,4 +1,16 @@ groups: + # system.* metrics + - id: metric.system.uptime + type: metric + metric_name: system.uptime + stability: experimental + brief: "The time the system has been running" + note: | + Instrumentations SHOULD use a gauge with type `double` and measure uptime in seconds as a floating point number with the highest precision available. + The actual accuracy would depend on the instrumentation and operating system. + instrument: gauge + unit: "s" + # system.cpu.* metrics - id: metric.system.cpu.time type: metric