Skip to content

Commit

Permalink
Add system uptime metric
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinnoel-be committed Oct 23, 2024
1 parent 35664be commit b559797
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .chloggen/add-system-uptime.yaml
Original file line number Diff line number Diff line change
@@ -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:
26 changes: 26 additions & 0 deletions docs/system/system-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- tocstop -->

Expand Down Expand Up @@ -1159,3 +1161,27 @@ See also the [Slab allocator](https://blogs.oracle.com/linux/post/understanding-
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## Uptime Metric

### Metric: `system.uptime`

This metric is [recommended][MetricRecommended].

<!-- semconv metric.system.uptime -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

| 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.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
13 changes: 13 additions & 0 deletions model/system/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []

0 comments on commit b559797

Please sign in to comment.