Repository navigation
fix(dashboard): read docker_stats container CPU as percent of one core - #326
Merged
Merged
Conversation
The Containers panel multiplied container.cpu.utilization by 100 whenever its unit was "1". docker_stats, the receiver the panel names as its source, already reports a percentage of one core (as docker stats does) while declaring unit "1", so on OpenTelemetry Demo data the panel showed 19,309% and 1,367% and marked every container bad. - Use docker_stats CPU values as reported; keep the unit conversion for other scopes. - Rank status against a reported container.cpu.limit. Without a CPU limit, CPU use is not a capacity signal, so status comes from memory against its limit, and the measurement column says the CPU limit is not reported. - The panel description states that 100% is one core. Claude-Session: https://claude.ai/code/session_01XA52nWyQ3R5f5kK8kjpAQW
vishr
force-pushed
the
fix/container-cpu
branch
from
October 16, 2026 21:23
cefa235 to
c418c96
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On OpenTelemetry Demo data the Containers panel showed CPU of 19,309% (load-generator) and 1,367% (payment), and every container was
bad.The panel multiplied
container.cpu.utilizationby 100 whenever its unit was"1". docker_stats, the receiver the panel names as its source, computes the value the waydocker statsdoes (cpuDelta / systemDelta * onlineCPUs * 100). The value is already a percentage of one core, even though the receiver declares unit"1". On the snapshot the scope isdockerstatsreceiver0.160.0, and values range from 0.53 to 193.46.container.cpu.limit. Without a CPU limit, CPU use is not a capacity signal, so status comes from memory against its limit. The measurement column then readscpu limit not reported.Evidence
One-hour Demo snapshot, frozen window, selected rows:
Tests cover:
"1";Verification
go test ./internal/dashboard/... ./internal/panel/...: passed.just check(pre-push): passed.