Skip to content

[k8s] Improve *.cpu.usage description#3931

Open
ChrsMark wants to merge 1 commit into
open-telemetry:mainfrom
ChrsMark:fix_cpu_usage_desc
Open

[k8s] Improve *.cpu.usage description#3931
ChrsMark wants to merge 1 commit into
open-telemetry:mainfrom
ChrsMark:fix_cpu_usage_desc

Conversation

@ChrsMark

@ChrsMark ChrsMark commented Jul 24, 2026

Copy link
Copy Markdown
Member

Related to #2418

Changes

After the relevant discussions at #2418, the @open-telemetry/semconv-k8s-approvers group decided to switch the implementation detail of how the *.cpu.usage metrics are populated.

Instead of deriving them directly from the Kubelet Stat's API and the UsageNanoCores in particular, the group decided that populating this metric on the fly, using the usageCores = (cpuTimeEnd - cpuTimeStart) / elapsedSeconds formula, is more accurate. Calculating this metric using the actual scraping interval is more accurate and correct than relying on the fixed interval based on which the Kubelet derived metric is calculated (as proved at #2418 (comment)).

This is also in alignment with the description of:

(Note that utilization = usage / limit)

The implementation switch is already in place behind a feature gate pair, introduced in the Collector by open-telemetry/opentelemetry-collector-contrib#49499.

This change is not a breaking change since the formula and concept for these metrics remain the same, with only the implementation detail being changed.

Merge requirement checklist

  • CONTRIBUTING.md guidelines followed.
  • Links to prototypes or existing instrumentations (when adding or changing conventions)
  • Disclose AI usage, see OTel GenAI policy:
    • no AI used
    • AI-assisted
    • bulk AI-generated
  • I have the experience and knowledge necessary to understand, review, and validate all content in this PR.1

/cc @open-telemetry/semconv-k8s-approvers @jmmcorreia

Footnotes

  1. Yes, I can answer maintainer questions about the content of this PR without using AI.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 24, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status last refreshed: 2026-07-25 10:12:41 UTC.

  • Waiting on: Reviewers
  • Next step: Review the latest changes.

This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected.

@ChrsMark ChrsMark moved this to In Review in K8s SemConv SIG Jul 24, 2026
@ChrsMark ChrsMark moved this from Untriaged to Awaiting codeowners approval in Semantic Conventions Triage Jul 24, 2026
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark
ChrsMark force-pushed the fix_cpu_usage_desc branch from 596708a to 38240b4 Compare July 24, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review
Status: Awaiting codeowners approval

Development

Successfully merging this pull request may close these issues.

1 participant