Skip to content

Commit

Permalink
[receiver/kubeletstats] Start name change for cpu.utilization (open-t…
Browse files Browse the repository at this point in the history
…elemetry#25901)

**Description:** 
Starts the name change processor for `*.cpu.utilization` metrics. 

**Link to tracking Issue:** 
Related to
open-telemetry#24905
Related to
open-telemetry#27885
  • Loading branch information
TylerHelmuth authored and cparkins committed Feb 1, 2024
1 parent a830e4a commit 8401215
Show file tree
Hide file tree
Showing 18 changed files with 439 additions and 89 deletions.
27 changes: 27 additions & 0 deletions .chloggen/kubeletstats-start-changing-cpu-utilization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: kubeletstatsreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add new `*.cpu.usage` metrics.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [25901]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
30 changes: 27 additions & 3 deletions receiver/kubeletstatsreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metrics:
### container.cpu.time
Container CPU time
Total cumulative CPU time (sum of all cores) spent by the container/pod/node since its creation
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
Expand Down Expand Up @@ -102,7 +102,7 @@ Container memory working_set
### k8s.node.cpu.time
Node CPU time
Total cumulative CPU time (sum of all cores) spent by the container/pod/node since its creation
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
Expand Down Expand Up @@ -220,7 +220,7 @@ Node network IO
### k8s.pod.cpu.time
Pod CPU time
Total cumulative CPU time (sum of all cores) spent by the container/pod/node since its creation
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
Expand Down Expand Up @@ -386,6 +386,14 @@ metrics:
enabled: true
```
### container.cpu.usage
Total CPU usage (sum of all cores per second) averaged over the sample window
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| {cpu} | Gauge | Double |
### container.uptime
The time since the container started
Expand Down Expand Up @@ -426,6 +434,14 @@ Container memory utilization as a ratio of the container's requests
| ---- | ----------- | ---------- |
| 1 | Gauge | Double |
### k8s.node.cpu.usage
Total CPU usage (sum of all cores per second) averaged over the sample window
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| {cpu} | Gauge | Double |
### k8s.node.uptime
The time since the node started
Expand All @@ -434,6 +450,14 @@ The time since the node started
| ---- | ----------- | ---------- | ----------------------- | --------- |
| s | Sum | Int | Cumulative | true |
### k8s.pod.cpu.usage
Total CPU usage (sum of all cores per second) averaged over the sample window
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| {cpu} | Gauge | Double |
### k8s.pod.cpu_limit_utilization
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.
Expand Down
1 change: 1 addition & 0 deletions receiver/kubeletstatsreceiver/internal/kubelet/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func addCPUUsageMetric(mb *metadata.MetricsBuilder, cpuMetrics metadata.CPUMetri
}
value := float64(*s.UsageNanoCores) / 1_000_000_000
cpuMetrics.Utilization(mb, currentTime, value)
cpuMetrics.Usage(mb, currentTime, value)

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8401215

Please sign in to comment.