Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .chloggen/fix_cpu_usage_desc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

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

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: k8s

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Clarifies how cpu.usage is calculated for K8s and container entities.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [2418]

# (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: |
CPU usage is meaasured in cores/CPUs and is calculated based on the formula:
`usageCores = (cpuTimeEnd - cpuTimeStart) / elapsedSeconds`
This PR improves the description making it aligned with the corresponding
system and prosses metrics.
2 changes: 1 addition & 1 deletion .chloggen/web_vital-attributes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ change_type: 'breaking'
component: browser

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Reworked the browser.web_vital event - moved name/value/delta/id from the event body to browser.web_vital.* attributes, and added new attributes per current instrumentation.
note: Reworked the browser.web_vital event - moved name/value/delta/ID from the event body to browser.web_vital.* attributes, and added new attributes per current instrumentation.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
Expand Down
2 changes: 1 addition & 1 deletion docs/system/container-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ This metric is [opt-in][MetricOptIn].
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `container.cpu.usage` | Gauge | `{cpu}` | Container's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs. [1] | ![Development](https://img.shields.io/badge/-development-blue) | [`container`](/docs/registry/entities/container.md#container) |

**[1]:** CPU usage of the specific container on all available CPU cores, averaged over the sample window
**[1]:** CPU usage of the specific container on all available CPU cores. It is calculated as the change in cumulative CPU time (container.cpu.time) over a measurement interval, divided by the elapsed time.

**Attributes:**

Expand Down
6 changes: 3 additions & 3 deletions docs/system/k8s-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ This metric is [recommended][MetricRecommended].
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `k8s.pod.cpu.usage` | Gauge | `{cpu}` | Pod's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs. [1] | ![Development](https://img.shields.io/badge/-development-blue) | [`k8s.pod`](/docs/registry/entities/k8s.md#k8s-pod) |

**[1]:** CPU usage of the specific Pod on all available CPU cores, averaged over the sample window
**[1]:** CPU usage of the specific Pod on all available CPU cores. It is calculated as the change in cumulative CPU time (k8s.pod.cpu.time) over a measurement interval, divided by the elapsed time.

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down Expand Up @@ -1063,7 +1063,7 @@ This metric is [recommended][MetricRecommended].
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `k8s.node.cpu.usage` | Gauge | `{cpu}` | Node's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs. [1] | ![Development](https://img.shields.io/badge/-development-blue) | [`k8s.node`](/docs/registry/entities/k8s.md#k8s-node) |

**[1]:** CPU usage of the specific Node on all available CPU cores, averaged over the sample window
**[1]:** CPU usage of the specific Node on all available CPU cores. It is calculated as the change in cumulative CPU time (k8s.node.cpu.time) over a measurement interval, divided by the elapsed time.

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down Expand Up @@ -1330,7 +1330,7 @@ This metric is [recommended][MetricRecommended].
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `k8s.node.system_container.cpu.usage` | Gauge | `{cpu}` | Node's system container CPU usage, measured in CPUs. [1] | ![Development](https://img.shields.io/badge/-development-blue) | [`k8s.node.system_container`](/docs/registry/entities/k8s.md#k8s-node-system-container) |

**[1]:** This metric is derived from the [CPUStats.UsageNanoCores](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L233) field of the [ContainerStats](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L157C6-L157C20) of [Node.SystemContainers](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L40) of the Kubelet's stats API.
**[1]:** CPU usage of the specific System Container on all available CPU cores. It is calculated as the change in cumulative CPU time (k8s.node.system_container.cpu.time) over a measurement interval, divided by the elapsed time.

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down
3 changes: 2 additions & 1 deletion model/container/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ groups:
stability: development
brief: "Container's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs."
note: >
CPU usage of the specific container on all available CPU cores, averaged over the sample window
CPU usage of the specific container on all available CPU cores. It is calculated as the change in
cumulative CPU time (container.cpu.time) over a measurement interval, divided by the elapsed time.
instrument: gauge
unit: "{cpu}"
entity_associations:
Expand Down
13 changes: 6 additions & 7 deletions model/k8s/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ groups:
stability: development
brief: "Pod's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs."
note: >
CPU usage of the specific Pod on all available CPU cores, averaged over the sample window
CPU usage of the specific Pod on all available CPU cores. It is calculated as the change in
cumulative CPU time (k8s.pod.cpu.time) over a measurement interval, divided by the elapsed time.
instrument: gauge
unit: "{cpu}"

Expand Down Expand Up @@ -554,7 +555,8 @@ groups:
stability: development
brief: "Node's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs."
note: >
CPU usage of the specific Node on all available CPU cores, averaged over the sample window
CPU usage of the specific Node on all available CPU cores. It is calculated as the change in
cumulative CPU time (k8s.node.cpu.time) over a measurement interval, divided by the elapsed time.
instrument: gauge
entity_associations:
- k8s.node
Expand All @@ -570,11 +572,8 @@ groups:
stability: development
brief: "Node's system container CPU usage, measured in CPUs."
note: >
This metric is derived from the
[CPUStats.UsageNanoCores](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L233)
field of the [ContainerStats](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L157C6-L157C20)
of [Node.SystemContainers](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L40)
of the Kubelet's stats API.
CPU usage of the specific System Container on all available CPU cores. It is calculated as the change in
cumulative CPU time (k8s.node.system_container.cpu.time) over a measurement interval, divided by the elapsed time.
instrument: gauge
entity_associations:
- k8s.node.system_container
Expand Down
Loading