Skip to content

Commit 74294cb

Browse files
authored
[receiver/kubeletstats] Start name change for cpu.utilization (#25901)
**Description:** Starts the name change processor for `*.cpu.utilization` metrics. **Link to tracking Issue:** Related to #24905 Related to #27885
1 parent 888d675 commit 74294cb

18 files changed

+439
-89
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: kubeletstatsreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add new `*.cpu.usage` metrics.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [25901]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

receiver/kubeletstatsreceiver/documentation.md

+27-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ metrics:
1414
1515
### container.cpu.time
1616
17-
Container CPU time
17+
Total cumulative CPU time (sum of all cores) spent by the container/pod/node since its creation
1818
1919
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
2020
| ---- | ----------- | ---------- | ----------------------- | --------- |
@@ -102,7 +102,7 @@ Container memory working_set
102102
103103
### k8s.node.cpu.time
104104
105-
Node CPU time
105+
Total cumulative CPU time (sum of all cores) spent by the container/pod/node since its creation
106106
107107
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
108108
| ---- | ----------- | ---------- | ----------------------- | --------- |
@@ -220,7 +220,7 @@ Node network IO
220220
221221
### k8s.pod.cpu.time
222222
223-
Pod CPU time
223+
Total cumulative CPU time (sum of all cores) spent by the container/pod/node since its creation
224224
225225
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
226226
| ---- | ----------- | ---------- | ----------------------- | --------- |
@@ -386,6 +386,14 @@ metrics:
386386
enabled: true
387387
```
388388
389+
### container.cpu.usage
390+
391+
Total CPU usage (sum of all cores per second) averaged over the sample window
392+
393+
| Unit | Metric Type | Value Type |
394+
| ---- | ----------- | ---------- |
395+
| {cpu} | Gauge | Double |
396+
389397
### container.uptime
390398
391399
The time since the container started
@@ -426,6 +434,14 @@ Container memory utilization as a ratio of the container's requests
426434
| ---- | ----------- | ---------- |
427435
| 1 | Gauge | Double |
428436
437+
### k8s.node.cpu.usage
438+
439+
Total CPU usage (sum of all cores per second) averaged over the sample window
440+
441+
| Unit | Metric Type | Value Type |
442+
| ---- | ----------- | ---------- |
443+
| {cpu} | Gauge | Double |
444+
429445
### k8s.node.uptime
430446
431447
The time since the node started
@@ -434,6 +450,14 @@ The time since the node started
434450
| ---- | ----------- | ---------- | ----------------------- | --------- |
435451
| s | Sum | Int | Cumulative | true |
436452
453+
### k8s.pod.cpu.usage
454+
455+
Total CPU usage (sum of all cores per second) averaged over the sample window
456+
457+
| Unit | Metric Type | Value Type |
458+
| ---- | ----------- | ---------- |
459+
| {cpu} | Gauge | Double |
460+
437461
### k8s.pod.cpu_limit_utilization
438462
439463
Pod cpu utilization as a ratio of the pod's total container limits. If any container is missing a limit the metric is not emitted.

receiver/kubeletstatsreceiver/internal/kubelet/cpu.go

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func addCPUUsageMetric(mb *metadata.MetricsBuilder, cpuMetrics metadata.CPUMetri
2424
}
2525
value := float64(*s.UsageNanoCores) / 1_000_000_000
2626
cpuMetrics.Utilization(mb, currentTime, value)
27+
cpuMetrics.Usage(mb, currentTime, value)
2728

2829
if r.cpuLimit > 0 {
2930
cpuMetrics.LimitUtilization(mb, currentTime, value/r.cpuLimit)

receiver/kubeletstatsreceiver/internal/metadata/generated_config.go

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/kubeletstatsreceiver/internal/metadata/generated_config_test.go

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)