Skip to content

Monitor CPU chart: distinguish "no CPU limit" from "limit metric unavailable" #1644

Backlog

Description

@pcbeingused333

Follow-up to #1633, as requested by @Rader there.

Problem. MonitorData CPU usage is reported as a percentage of the workload's CPU limit. When the limit cannot be resolved, the code falls back to limit = 1 only to avoid division by zero (+Inf/NaN). The result is that a workload using 2 cores with no resolvable limit is shown as 100% after clamping, and the UI cannot tell two different situations apart:

  1. the workload is confirmed to have no CPU limit configured;
  2. the limit metric is unavailable (query failed, series missing, label mismatch).

A missing metric alone should not be treated as proof that there is no limit.

Proposal (shape open for discussion).

  • Return a null/absent percentage plus an explicit state for the limit (e.g. limit_state: configured | none | unavailable), so the UI can render "No limit" or "No data" instead of a made-up percentage.
  • Optionally report usage in cores in the no-limit / unavailable cases, so the chart still shows something useful.
  • Make sure the usage and limit queries refer to the same container (same label selectors), so the ratio is meaningful.
  • Keep the existing percentage contract unchanged when a limit is found.

This needs a response-contract decision and a frontend change, so I'd like to agree on the shape here before writing code. Happy to send a PR for the backend part once you pick one.

This was drafted with Claude Code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions