Skip to content

bug(platform): Usage metrics turn a failed read into zero-valued analytics #3867

Closed

Description

@yannickmonney

Bug: Usage metrics turn a failed read into zero-valued analytics

  • Classification: P2 confirmed product defect (Analytics / Usage)
  • Source SHA: 9ea5972
  • Replay: /Users/yannick/.codex/notes/tale-1000-additional/analytics-metrics-read-errors-probe.log
  • Scope: isolated local jsdom/Vitest component probe; no production network or writes.

Reproduction

Render UsageMetricsPage for an organization while governance/queries:getOrgUsageMetrics settles with data: undefined, isLoading: false, and a 503 error. The real page renders the normal Usage metrics heading, summary cards with zero values, empty charts/tables, and the Filter control. It renders no alert, no error copy, and no Retry action. The combined replay passed the Usage case against source SHA 9ea59724df24d62729a9360f3902d964dab39b3e.

Root cause and impact

UsageMetricsPage destructures only data and isLoading from useBackendQuery. UsageMetricsPageView then uses optional chaining and numeric fallbacks (summary?.totalRequests ?? 0, empty series, empty tables), so a rejected metrics read is indistinguishable from a successful organization with no usage. Filters remain interactive and can issue more requests, but the user has no indication that the displayed zeros are unavailable data. This can mislead billing, capacity, and incident decisions.

Expected behavior is a distinct failed-read state with the backend error and a Retry action, preserving selected filters. This is separate from an authenticated organization with genuinely empty usage, which should keep the zero state.

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

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions