Skip to content

Commit 127c8f4

Browse files
ShaanveerSbraydonk
andauthored
[receiver/hostmetricsreceiver] Align hugepages instrument types (#47217)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description `system.memory.linux.hugepages.page_size`, `system.memory.linux.hugepages.reserved`, and `system.memory.linux.hugepages.surplus` should be emitted as updowncounters rather than gauges. Context: open-telemetry/semantic-conventions#3516 (comment) <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> Signed-off-by: Shaanveer Singh <shaanver.singh@gmail.com> Co-authored-by: Braydon Kains <93549768+braydonk@users.noreply.github.com>
1 parent 1566c3d commit 127c8f4

File tree

5 files changed

+63
-36
lines changed

5 files changed

+63
-36
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
change_type: bug_fix
2+
3+
component: receiver/hostmetrics
4+
5+
note: Align HugePages metric instrument types with the semantic conventions by emitting page_size, reserved, and surplus as non-monotonic sums instead of gauges.
6+
7+
issues: [42650]
8+
9+
subtext:
10+
11+
change_logs: [user]

receiver/hostmetricsreceiver/internal/scraper/memoryscraper/documentation.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,25 +72,25 @@ Total number of hugepages available.
7272

7373
System hugepage size in bytes.
7474

75-
| Unit | Metric Type | Value Type | Stability |
76-
| ---- | ----------- | ---------- | --------- |
77-
| By | Gauge | Int | Development |
75+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
76+
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
77+
| By | Sum | Int | Cumulative | false | Development |
7878

7979
### system.memory.linux.hugepages.reserved
8080

8181
Number of reserved hugepages (hugepages for which a commitment to allocate has been made, but no allocation has yet been made). This is reported as a separate metric rather than a usage state because reserved pages are already counted in free pages - they represent a subset of free pages that cannot be used for non-reserved allocations.
8282

83-
| Unit | Metric Type | Value Type | Stability |
84-
| ---- | ----------- | ---------- | --------- |
85-
| {page} | Gauge | Int | Development |
83+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
84+
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
85+
| {page} | Sum | Int | Cumulative | false | Development |
8686

8787
### system.memory.linux.hugepages.surplus
8888

8989
Number of surplus hugepages (overcommitted hugepages beyond the persistent pool). This is reported as a separate metric rather than a usage state because surplus pages can be in either used or free state, and including them would break the semantic convention that usage states must sum to the limit.
9090

91-
| Unit | Metric Type | Value Type | Stability |
92-
| ---- | ----------- | ---------- | --------- |
93-
| {page} | Gauge | Int | Development |
91+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability |
92+
| ---- | ----------- | ---------- | ----------------------- | --------- | --------- |
93+
| {page} | Sum | Int | Cumulative | false | Development |
9494

9595
### system.memory.linux.hugepages.usage
9696

receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_metrics.go

Lines changed: 21 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_metrics_test.go

Lines changed: 15 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/hostmetricsreceiver/internal/scraper/memoryscraper/metadata.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ metrics:
7070
description: System hugepage size in bytes.
7171
unit: By
7272
stability: development
73-
gauge:
73+
sum:
7474
value_type: int
7575
aggregation_temporality: cumulative
7676
monotonic: false
@@ -80,16 +80,20 @@ metrics:
8080
description: Number of reserved hugepages (hugepages for which a commitment to allocate has been made, but no allocation has yet been made). This is reported as a separate metric rather than a usage state because reserved pages are already counted in free pages - they represent a subset of free pages that cannot be used for non-reserved allocations.
8181
unit: "{page}"
8282
stability: development
83-
gauge:
83+
sum:
8484
value_type: int
85+
aggregation_temporality: cumulative
86+
monotonic: false
8587

8688
system.memory.linux.hugepages.surplus:
8789
enabled: false
8890
description: Number of surplus hugepages (overcommitted hugepages beyond the persistent pool). This is reported as a separate metric rather than a usage state because surplus pages can be in either used or free state, and including them would break the semantic convention that usage states must sum to the limit.
8991
unit: "{page}"
9092
stability: development
91-
gauge:
93+
sum:
9294
value_type: int
95+
aggregation_temporality: cumulative
96+
monotonic: false
9397

9498
system.memory.linux.hugepages.usage:
9599
enabled: false

0 commit comments

Comments
 (0)