Skip to content

Commit 5c11479

Browse files
authored
move all hardware metrics to their own yaml files (#2380)
1 parent f253d58 commit 5c11479

39 files changed

+4701
-372
lines changed

.chloggen/hw_battery.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Use this changelog template to create an entry for release notes.
2+
#
3+
# If your change doesn't affect end users you should instead start
4+
# your pull request title with [chore] or use the "Skip Changelog" label.
5+
6+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
7+
change_type: enhancement
8+
9+
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
10+
component: hardware
11+
12+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
13+
note: Move text hardware metrics to the hardware components, yaml and md files
14+
15+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
16+
# The values here must be integers.
17+
issues: [2380]
18+
19+
# (Optional) One or more lines of additional information to render under the primary note.
20+
# These lines will be padded with 2 spaces and then inserted directly into the document.
21+
# Use pipe (|) for multiline entries.
22+
subtext:

.github/workflows/reusable-link-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ jobs:
2626
run: |
2727
merge_base=$(git merge-base origin/${{ github.base_ref }} HEAD)
2828
# Using lychee's default extension filter here to match when it runs against all files
29-
modified_files=$(git diff --name-only $merge_base...${{ github.event.pull_request.head.sha }} \
29+
# --diff-filter=d excludes deleted files
30+
modified_files=$(git diff --name-only --diff-filter=d $merge_base...${{ github.event.pull_request.head.sha }} \
3031
| grep -E '\.(md|mkd|mdx|mdown|mdwn|mkdn|mkdown|markdown|html|htm|txt)$' \
3132
| tr '\n' ' ' || true)
3233
echo "files=$modified_files" >> $GITHUB_OUTPUT

docs/general/metrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The following semantic conventions surrounding metrics are defined:
3030
* **System metrics**
3131
* [System](/docs/system/system-metrics.md): For standard system metrics.
3232
* [Container](/docs/system/container-metrics.md)
33-
* [Hardware](/docs/system/hardware-metrics.md): For hardware-related metrics.
33+
* [Hardware](/docs/hardware/README.md): For hardware-related metrics.
3434
* [K8s](/docs/system/k8s-metrics.md): For K8s metrics.
3535
* [Process](/docs/system/process-metrics.md): For standard process metrics.
3636
* [Runtime Environment](/docs/runtime/README.md#metrics): For runtime environment metrics.

docs/hardware/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,19 @@ Semantic conventions for hardware are defined as following:
1414

1515
* [Common Hardware Metrics](common.md): Semantic Conventions for *common* hardware metrics.
1616
* [Physical Host Metrics](host.md): Semantic Conventions for *physical host* metrics.
17+
* [Battery Metrics](battery.md): Semantic Conventions for *battery* metrics.
18+
* [CPU Metrics](cpu.md): Semantic Conventions for *CPU* metrics.
19+
* [Disk Controller Metrics](disk-controller.md): Semantic Conventions for *disk controller* metrics.
20+
* [Enclosure Metrics](enclosure.md): Semantic Conventions for *enclosure* metrics.
21+
* [Fan Metrics](fan.md): Semantic Conventions for *fan* metrics.
22+
* [GPU Metrics](gpu.md): Semantic Conventions for *GPU* metrics.
23+
* [Logical Disk Metrics](logical-disk.md): Semantic Conventions for *logical disk* metrics.
24+
* [Memory Metrics](memory.md): Semantic Conventions for *memory* metrics.
25+
* [Network Metrics](network.md): Semantic Conventions for *network* metrics.
26+
* [Physical Disk Metrics](physical-disk.md): Semantic Conventions for *physical disk* metrics.
27+
* [Power Supply Metrics](power-supply.md): Semantic Conventions for *power supply* metrics.
28+
* [Tape Drive Metrics](tape-drive.md): Semantic Conventions for *tape drive* metrics.
29+
* [Temperature Metrics](temperature.md): Semantic Conventions for *temperature* metrics.
30+
* [Voltage Metrics](voltage.md): Semantic Conventions for *voltage* metrics.
1731

1832
[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status

docs/hardware/battery.md

Lines changed: 261 additions & 0 deletions
Large diffs are not rendered by default.

docs/hardware/common.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The below metrics apply to any type of hardware component.
2626

2727
These common `hw.` metrics include the below attributes to describe the
2828
monitored component:
29-
<!-- semconv metric.hw.attributes -->
29+
<!-- semconv metric_attributes.hw.attributes -->
3030
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
3131
<!-- see templates/registry/markdown/snippet.md.j2 -->
3232
<!-- prettier-ignore-start -->
@@ -137,14 +137,17 @@ This metric is [recommended][MetricRecommended].
137137
|---|---|---|---|---|---|
138138
| [`hw.id`](/docs/registry/attributes/hardware.md) | string | An identifier for the hardware component, unique within the monitored host | `win32battery_battery_testsysa33_1` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
139139
| [`hw.type`](/docs/registry/attributes/hardware.md) | string | Type of the component [1] | `battery`; `cpu`; `disk_controller` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
140-
| [`error.type`](/docs/registry/attributes/error.md) | string | The type of error encountered by the component [2] | `uncorrected`; `zero_buffer_credit`; `crc`; `bad_sector` | `Conditionally Required` if and only if an error has occurred | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
140+
| [`error.type`](/docs/registry/attributes/error.md) | string | The type of error encountered by the component. [2] | `uncorrected`; `zero_buffer_credit`; `crc`; `bad_sector` | `Conditionally Required` if and only if an error has occurred | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
141141
| [`hw.name`](/docs/registry/attributes/hardware.md) | string | An easily-recognizable name for the hardware component | `eth0` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
142142
| [`hw.parent`](/docs/registry/attributes/hardware.md) | string | Unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk controller) | `dellStorage_perc_0` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
143+
| [`network.io.direction`](/docs/registry/attributes/network.md) | string | Direction of network traffic for network errors. [3] | `receive`; `transmit` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
143144

144145
**[1] `hw.type`:** Describes the category of the hardware component for which `hw.state` is being reported. For example, `hw.type=temperature` along with `hw.state=degraded` would indicate that the temperature of the hardware component has been reported as `degraded`.
145146

146147
**[2] `error.type`:** The `error.type` SHOULD match the error code reported by the component, the canonical name of the error, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report.
147148

149+
**[3] `network.io.direction`:** This attribute SHOULD only be used when `hw.type` is set to `"network"` to indicate the direction of the error.
150+
148151
---
149152

150153
`error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
@@ -174,6 +177,15 @@ This metric is [recommended][MetricRecommended].
174177
| `temperature` | Temperature | ![Development](https://img.shields.io/badge/-development-blue) |
175178
| `voltage` | Voltage | ![Development](https://img.shields.io/badge/-development-blue) |
176179

180+
---
181+
182+
`network.io.direction` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
183+
184+
| Value | Description | Stability |
185+
|---|---|---|
186+
| `receive` | receive | ![Development](https://img.shields.io/badge/-development-blue) |
187+
| `transmit` | transmit | ![Development](https://img.shields.io/badge/-development-blue) |
188+
177189
<!-- markdownlint-restore -->
178190
<!-- prettier-ignore-end -->
179191
<!-- END AUTOGENERATED TEXT -->
@@ -251,7 +263,7 @@ This metric is [recommended][MetricRecommended].
251263
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
252264
|---|---|---|---|---|---|
253265
| [`hw.id`](/docs/registry/attributes/hardware.md) | string | An identifier for the hardware component, unique within the monitored host | `win32battery_battery_testsysa33_1` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
254-
| [`hw.state`](/docs/registry/attributes/hardware.md) | string | The current state of the component | `ok`; `degraded`; `failed` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
266+
| [`hw.state`](/docs/registry/attributes/hardware.md) | string | The current state of the component | `degraded`; `failed`; `needs_cleaning` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
255267
| [`hw.type`](/docs/registry/attributes/hardware.md) | string | Type of the component [1] | `battery`; `cpu`; `disk_controller` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
256268
| [`hw.name`](/docs/registry/attributes/hardware.md) | string | An easily-recognizable name for the hardware component | `eth0` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
257269
| [`hw.parent`](/docs/registry/attributes/hardware.md) | string | Unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk controller) | `dellStorage_perc_0` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
@@ -266,7 +278,9 @@ This metric is [recommended][MetricRecommended].
266278
|---|---|---|
267279
| `degraded` | Degraded | ![Development](https://img.shields.io/badge/-development-blue) |
268280
| `failed` | Failed | ![Development](https://img.shields.io/badge/-development-blue) |
269-
| `ok` | Ok | ![Development](https://img.shields.io/badge/-development-blue) |
281+
| `needs_cleaning` | Needs Cleaning | ![Development](https://img.shields.io/badge/-development-blue) |
282+
| `ok` | OK | ![Development](https://img.shields.io/badge/-development-blue) |
283+
| `predicted_failure` | Predicted Failure | ![Development](https://img.shields.io/badge/-development-blue) |
270284

271285
---
272286

0 commit comments

Comments
 (0)