Skip to content

bug(monitoring): agent health reports a measured 0% uptime and 0 ms latency as "not measured" #4685

Open

Description

@trinity-ability

Summary

GET /api/monitoring/agents/{name} builds its 24h figures with a truthiness test:

uptime_percent_24h=round(uptime, 2) if uptime else None,
avg_latency_24h_ms=round(avg_latency, 2) if avg_latency else None,

(src/backend/routers/monitoring.py, in the agent health detail handler.) A measured uptime of 0.0 — an agent unreachable for the whole 24 hours — is falsy, so the response carries null. Every consumer reads null as "never measured" and shows a dash, so the worst possible reading is displayed as no reading.

Context

Found in the pre-landing review of #4684 (Agent Detail Overview rebuild). The Overview's Health card follows the rule "a value never measured is a dash, never 0"; this bug breaks the same rule in reverse.

Acceptance Criteria

  • Both fields use is not None, so 0.0 is returned as 0.0.
  • A unit test seeds an agent with only unreachable checks in the window and asserts uptime_percent_24h == 0.0, not None.
  • An agent with no checks in the window still returns None for both.

Activity

  1. added
    priority-p3
    type-bug
    theme-reliability
    complexity-low
    status-ready
    on Nov 20, 2026
  2. added a commit that references this issue on Nov 21, 2026
    38084ec
  3. added
    status-in-dev
    on Nov 21, 2026
  4. removed
    status-ready
    on Nov 23, 2026
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

    complexity-lowpriority-p3status-in-devtheme-reliabilitytype-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions