Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add system uptime metric #1507

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
27 changes: 27 additions & 0 deletions docs/system/system-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Resource attributes related to a host, SHOULD be reported under the `host.*` nam

<!-- toc -->

- [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)
Expand Down Expand Up @@ -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].

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

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## Processor Metrics

**Description:** System level processor metrics captured under the namespace `system.cpu`.
Expand Down
12 changes: 12 additions & 0 deletions model/system/metrics.yaml
Original file line number Diff line number Diff line change
@@ -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"
kevinnoel-be marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
Loading