From 26f499279fd396d08d7d8cbfae22fe97ca754c26 Mon Sep 17 00:00:00 2001 From: Chris Mark Date: Thu, 26 Oct 2023 11:45:24 +0100 Subject: [PATCH] Add `system.cpu.frequency` metric. (#337) Signed-off-by: ChrsMark Co-authored-by: Pablo Baeyens --- CHANGELOG.md | 2 ++ docs/system/system-metrics.md | 17 +++++++++++++++++ model/metrics/system-metrics.yaml | 9 +++++++++ 3 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1382e9c0d..a7e7f656d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -182,6 +182,8 @@ release. - BREAKING: Rename `telemetry.auto.version` resource attribute to `telemetry.distro.version` and add `telemetry.distro.name` resource attribute ([#178](https://github.com/open-telemetry/semantic-conventions/pull/178)) +- Add `system.cpu.frequency` metric. + ([#337](https://github.com/open-telemetry/semantic-conventions/pull/337)) - Improve HTTP metric briefs. ([#366](https://github.com/open-telemetry/semantic-conventions/pull/366)) - Add `host.ip` resource attribute convention. diff --git a/docs/system/system-metrics.md b/docs/system/system-metrics.md index 14254bf534..c7bdd1703f 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -26,6 +26,7 @@ Resource attributes related to a host, SHOULD be reported under the `host.*` nam * [Metric: `system.cpu.utilization`](#metric-systemcpuutilization) * [Metric: `system.cpu.physical.count`](#metric-systemcpuphysicalcount) * [Metric: `system.cpu.logical.count`](#metric-systemcpulogicalcount) + * [Metric: `system.cpu.frequency`](#metric-systemcpufrequency) - [Memory Metrics](#memory-metrics) * [Metric: `system.memory.usage`](#metric-systemmemoryusage) * [Metric: `system.memory.utilization`](#metric-systemmemoryutilization) @@ -145,6 +146,22 @@ This metric is [recommended][MetricRecommended]. +### Metric: `system.cpu.frequency` + +This metric is [recommended][MetricRecommended]. + + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `system.cpu.frequency` | Gauge | `{Hz}` | Reports the current frequency of the CPU in Hz | + + + +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `system.cpu.logical_number` | int | The logical CPU number [0..n-1] | `1` | Recommended | + + ## Memory Metrics **Description:** System level memory metrics capture under the namespace `system.memory`. diff --git a/model/metrics/system-metrics.yaml b/model/metrics/system-metrics.yaml index eb69d3f992..9f582e4b19 100644 --- a/model/metrics/system-metrics.yaml +++ b/model/metrics/system-metrics.yaml @@ -61,6 +61,15 @@ groups: - ref: system.cpu.state - ref: system.cpu.logical_number + - id: metric.system.cpu.frequency + type: metric + metric_name: system.cpu.frequency + brief: "Reports the current frequency of the CPU in Hz" + instrument: gauge + unit: "{Hz}" + attributes: + - ref: system.cpu.logical_number + - id: metric.system.cpu.physical.count type: metric metric_name: system.cpu.physical.count