Skip to content

Commit b559797

Browse files
committed
Add system uptime metric
1 parent 35664be commit b559797

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

.chloggen/add-system-uptime.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: enhancement
3+
4+
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
5+
component: system
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Add system uptime metric
9+
10+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
11+
# The values here must be integers.
12+
issues: [648]
13+
14+
# (Optional) One or more lines of additional information to render under the primary note.
15+
# These lines will be padded with 2 spaces and then inserted directly into the document.
16+
# Use pipe (|) for multiline entries.
17+
subtext:

docs/system/system-metrics.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ Resource attributes related to a host, SHOULD be reported under the `host.*` nam
6060
- [`system.{os}.` - OS Specific System Metrics](#systemos---os-specific-system-metrics)
6161
- [Metric: `system.linux.memory.available`](#metric-systemlinuxmemoryavailable)
6262
- [Metric: `system.linux.memory.slab.usage`](#metric-systemlinuxmemoryslabusage)
63+
- [Uptime Metric](#uptime-metric)
64+
- [Metric: `system.uptime`](#metric-systemuptime)
6365

6466
<!-- tocstop -->
6567

@@ -1159,3 +1161,27 @@ See also the [Slab allocator](https://blogs.oracle.com/linux/post/understanding-
11591161
<!-- prettier-ignore-end -->
11601162
<!-- END AUTOGENERATED TEXT -->
11611163
<!-- endsemconv -->
1164+
1165+
## Uptime Metric
1166+
1167+
### Metric: `system.uptime`
1168+
1169+
This metric is [recommended][MetricRecommended].
1170+
1171+
<!-- semconv metric.system.uptime -->
1172+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
1173+
<!-- see templates/registry/markdown/snippet.md.j2 -->
1174+
<!-- prettier-ignore-start -->
1175+
<!-- markdownlint-capture -->
1176+
<!-- markdownlint-disable -->
1177+
1178+
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
1179+
| -------- | --------------- | ----------- | -------------- | --------- |
1180+
| `system.uptime` | Counter | `s` | The time the system has been running [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
1181+
1182+
**[1]:** Instrumentations SHOULD use counter with type `double` and measure uptime with the highest precision available.
1183+
The actual accuracy would depend on the instrumentation and operating system.
1184+
1185+
<!-- markdownlint-restore -->
1186+
<!-- prettier-ignore-end -->
1187+
<!-- END AUTOGENERATED TEXT -->

model/system/metrics.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,3 +394,16 @@ groups:
394394
unit: "By"
395395
attributes:
396396
- ref: linux.memory.slab.state
397+
398+
# system.uptime metric
399+
- id: metric.system.uptime
400+
type: metric
401+
metric_name: system.uptime
402+
stability: experimental
403+
brief: "The time the system has been running"
404+
note: |
405+
Instrumentations SHOULD use counter with type `double` and measure uptime with the highest precision available.
406+
The actual accuracy would depend on the instrumentation and operating system.
407+
instrument: counter
408+
unit: "s"
409+
attributes: []

0 commit comments

Comments
 (0)