Skip to content

Commit efb6ccd

Browse files
authored
[chore] move hardware host metrics to the yaml format (#1927)
1 parent bdb26d9 commit efb6ccd

File tree

4 files changed

+183
-19
lines changed

4 files changed

+183
-19
lines changed

docs/hardware/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ when creating instruments not explicitly defined in the specification.
1313
Semantic conventions for hardware are defined as following:
1414

1515
* [Common Hardware Metrics](common.md): Semantic Conventions for *common* hardware metrics.
16+
* [Physical Host Metrics](host.md): Semantic Conventions for *physical host* metrics.
1617

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

docs/hardware/host.md

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<!--- Hugo front matter used to generate the website version of this page:
2+
linkTitle: Common
3+
--->
4+
5+
# Semantic conventions for physical host metrics
6+
7+
**Status**: [Development][DocumentStatus]
8+
9+
<!-- toc -->
10+
11+
- [Physical host metrics `hw.host.*`](#physical-host-metrics-hwhost)
12+
- [Metric: `hw.host.ambient_temperature`](#metric-hwhostambient_temperature)
13+
- [Metric: `hw.host.energy`](#metric-hwhostenergy)
14+
- [Metric: `hw.host.heating_margin`](#metric-hwhostheating_margin)
15+
- [Metric: `hw.host.power`](#metric-hwhostpower)
16+
17+
<!-- tocstop -->
18+
19+
## Physical host metrics `hw.host.*`
20+
21+
Physical system as opposed to a virtual system or a container.
22+
Examples: physical server, switch or disk array.
23+
24+
### Metric: `hw.host.ambient_temperature`
25+
26+
This metric is [recommended][MetricRecommended].
27+
28+
<!-- semconv metric.hw.host.ambient_temperature -->
29+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
30+
<!-- see templates/registry/markdown/snippet.md.j2 -->
31+
<!-- prettier-ignore-start -->
32+
<!-- markdownlint-capture -->
33+
<!-- markdownlint-disable -->
34+
35+
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
36+
| -------- | --------------- | ----------- | -------------- | --------- |
37+
| `hw.host.ambient_temperature` | Gauge | `Cel` | Ambient (external) temperature of the physical host | ![Development](https://img.shields.io/badge/-development-blue) |
38+
39+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
40+
|---|---|---|---|---|---|
41+
| [`hw.id`](/docs/attributes-registry/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) |
42+
| [`hw.name`](/docs/attributes-registry/hardware.md) | string | An easily-recognizable name for the hardware component | `eth0` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
43+
| [`hw.parent`](/docs/attributes-registry/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) |
44+
45+
<!-- markdownlint-restore -->
46+
<!-- prettier-ignore-end -->
47+
<!-- END AUTOGENERATED TEXT -->
48+
<!-- endsemconv -->
49+
50+
### Metric: `hw.host.energy`
51+
52+
This metric is [recommended][MetricRecommended].
53+
54+
<!-- semconv metric.hw.host.energy -->
55+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
56+
<!-- see templates/registry/markdown/snippet.md.j2 -->
57+
<!-- prettier-ignore-start -->
58+
<!-- markdownlint-capture -->
59+
<!-- markdownlint-disable -->
60+
61+
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
62+
| -------- | --------------- | ----------- | -------------- | --------- |
63+
| `hw.host.energy` | Counter | `J` | Total energy consumed by the entire physical host, in joules [1] | ![Development](https://img.shields.io/badge/-development-blue) |
64+
65+
**[1]:** The overall energy usage of a host MUST be reported using the specific `hw.host.energy` and `hw.host.power` metrics **only**, instead of the generic `hw.energy` and `hw.power` described in the previous section, to prevent summing up overlapping values.
66+
67+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
68+
|---|---|---|---|---|---|
69+
| [`hw.id`](/docs/attributes-registry/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) |
70+
| [`hw.name`](/docs/attributes-registry/hardware.md) | string | An easily-recognizable name for the hardware component | `eth0` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
71+
| [`hw.parent`](/docs/attributes-registry/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) |
72+
73+
<!-- markdownlint-restore -->
74+
<!-- prettier-ignore-end -->
75+
<!-- END AUTOGENERATED TEXT -->
76+
<!-- endsemconv -->
77+
78+
### Metric: `hw.host.heating_margin`
79+
80+
This metric is [recommended][MetricRecommended].
81+
82+
<!-- semconv metric.hw.host.heating_margin -->
83+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
84+
<!-- see templates/registry/markdown/snippet.md.j2 -->
85+
<!-- prettier-ignore-start -->
86+
<!-- markdownlint-capture -->
87+
<!-- markdownlint-disable -->
88+
89+
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
90+
| -------- | --------------- | ----------- | -------------- | --------- |
91+
| `hw.host.heating_margin` | Gauge | `Cel` | By how many degrees Celsius the temperature of the physical host can be increased, before reaching a warning threshold on one of the internal sensors | ![Development](https://img.shields.io/badge/-development-blue) |
92+
93+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
94+
|---|---|---|---|---|---|
95+
| [`hw.id`](/docs/attributes-registry/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) |
96+
| [`hw.name`](/docs/attributes-registry/hardware.md) | string | An easily-recognizable name for the hardware component | `eth0` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
97+
| [`hw.parent`](/docs/attributes-registry/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) |
98+
99+
<!-- markdownlint-restore -->
100+
<!-- prettier-ignore-end -->
101+
<!-- END AUTOGENERATED TEXT -->
102+
<!-- endsemconv -->
103+
104+
### Metric: `hw.host.power`
105+
106+
This metric is [recommended][MetricRecommended].
107+
108+
<!-- semconv metric.hw.host.power -->
109+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
110+
<!-- see templates/registry/markdown/snippet.md.j2 -->
111+
<!-- prettier-ignore-start -->
112+
<!-- markdownlint-capture -->
113+
<!-- markdownlint-disable -->
114+
115+
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
116+
| -------- | --------------- | ----------- | -------------- | --------- |
117+
| `hw.host.power` | Gauge | `W` | Instantaneous power consumed by the entire physical host in Watts (`hw.host.energy` is preferred) [1] | ![Development](https://img.shields.io/badge/-development-blue) |
118+
119+
**[1]:** The overall energy usage of a host MUST be reported using the specific `hw.host.energy` and `hw.host.power` metrics **only**, instead of the generic `hw.energy` and `hw.power` described in the previous section, to prevent summing up overlapping values.
120+
121+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
122+
|---|---|---|---|---|---|
123+
| [`hw.id`](/docs/attributes-registry/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) |
124+
| [`hw.name`](/docs/attributes-registry/hardware.md) | string | An easily-recognizable name for the hardware component | `eth0` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
125+
| [`hw.parent`](/docs/attributes-registry/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) |
126+
127+
<!-- markdownlint-restore -->
128+
<!-- prettier-ignore-end -->
129+
<!-- END AUTOGENERATED TEXT -->
130+
<!-- endsemconv -->
131+
132+
[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
133+
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended

docs/system/hardware-metrics.md

+1-19
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Please note that this is an [ongoing process](https://github.com/open-telemetry/
2020
- [Common hardware attributes](/docs/attributes-registry/hardware.md)
2121
- [Metric Instruments](#metric-instruments)
2222
- [`hw.` - Common hardware metrics](/docs/hardware/common.md)
23-
- [`hw.host.` - Physical host metrics](#hwhost---physical-host-metrics)
23+
- [`hw.host.` - Physical host metrics](/docs/hardware/host.md)
2424
- [`hw.battery.` - Battery metrics](#hwbattery---battery-metrics)
2525
- [`hw.cpu.` - Physical processor metrics](#hwcpu---physical-processor-metrics)
2626
- [`hw.disk_controller.` - Disk controller metrics](#hwdisk_controller---disk-controller-metrics)
@@ -49,24 +49,6 @@ Please note that this is an [ongoing process](https://github.com/open-telemetry/
4949
5050
## Metric Instruments
5151

52-
### `hw.host.` - Physical host metrics
53-
54-
**Description:** Physical system as opposed to a virtual system or a container.
55-
Examples: physical server, switch or disk array.
56-
57-
| Name | Description | Units | Instrument Type ([*](/docs/general/metrics.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values |
58-
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | ------------------------------------------------- | ---------- | ---------------- | ---------------- |
59-
| `hw.host.ambient_temperature` | Ambient (external) temperature of the physical host | Cel | Gauge | Double | | |
60-
| `hw.host.energy` | Total energy consumed by the entire physical host, in joules | J | Counter | Int64 | | |
61-
| `hw.host.heating_margin` | By how many degrees Celsius the temperature of the physical host can be increased, before reaching a warning threshold on one of the internal sensors | Cel | Gauge | Double | | |
62-
| `hw.host.power` | Instantaneous power consumed by the entire physical host in Watts (`hw.host.energy` is preferred) | W | Gauge | Double | | |
63-
64-
> **Note**
65-
> The overall energy usage of a host MUST be reported using the specific
66-
> `hw.host.energy` and `hw.host.power` metrics **only**, instead of the generic
67-
> `hw.energy` and `hw.power` described in the previous section, to prevent
68-
> summing up overlapping values.
69-
7052
### `hw.battery.` - Battery metrics
7153

7254
**Description:** A battery in a computer system or an UPS.

model/hardware/host-metrics.yaml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
groups:
2+
# HOST METRICS
3+
- id: metric.hw.host.ambient_temperature
4+
type: metric
5+
metric_name: hw.host.ambient_temperature
6+
stability: development
7+
brief: "Ambient (external) temperature of the physical host"
8+
instrument: gauge
9+
unit: "Cel"
10+
extends: hardware.attributes.common
11+
12+
- id: metric.hw.host.energy
13+
type: metric
14+
metric_name: hw.host.energy
15+
stability: development
16+
brief: "Total energy consumed by the entire physical host, in joules"
17+
instrument: counter
18+
unit: "J"
19+
extends: hardware.attributes.common
20+
note: >
21+
The overall energy usage of a host MUST be reported using the specific `hw.host.energy` and `hw.host.power`
22+
metrics **only**, instead of the generic `hw.energy` and `hw.power` described in the previous section, to prevent
23+
summing up overlapping values.
24+
25+
- id: metric.hw.host.heating_margin
26+
type: metric
27+
metric_name: hw.host.heating_margin
28+
stability: experimental
29+
brief: >
30+
By how many degrees Celsius the temperature of the physical host can be increased, before reaching a warning
31+
threshold on one of the internal sensors
32+
instrument: gauge
33+
unit: "Cel"
34+
extends: hardware.attributes.common
35+
36+
- id: metric.hw.host.power
37+
type: metric
38+
metric_name: hw.host.power
39+
stability: experimental
40+
brief: >
41+
Instantaneous power consumed by the entire physical host in Watts (`hw.host.energy` is preferred)
42+
instrument: gauge
43+
unit: "W"
44+
extends: hardware.attributes.common
45+
note: >
46+
The overall energy usage of a host MUST be reported using the specific `hw.host.energy` and `hw.host.power`
47+
metrics **only**, instead of the generic `hw.energy` and `hw.power` described in the previous section, to prevent
48+
summing up overlapping values.

0 commit comments

Comments
 (0)