Summary
The analytics endpoint that backs the Home page Savings-over-time chart accepts an account_ids filter but no provider param. PR #746 brought chart and KPI cards into account-filter parity, but when the user applies a provider filter (e.g. only AWS, only Azure), the KPIs above the chart correctly scope to the chosen provider while the chart aggregates across all providers — so the numbers drift visibly.
Repro
- Open the Home page.
- Apply a provider filter chip (e.g. "Azure").
- Compare the "Potential Monthly Savings" KPI to the sum of the chart's last-N-days datapoints.
- The KPI scopes to Azure; the chart still aggregates AWS + Azure + GCP.
Fix
Add a provider (or providers[] for multi-select) query param to the analytics handler. Mirror the same filter semantics as the KPI endpoint so the two sources of truth share the same scoping rules.
Suggested touchpoints (verify before editing):
internal/api/handler_dashboard.go (or wherever getSavingsOverTime / the analytics route lives)
frontend/src/dashboard.ts — pass provider alongside account_ids when fetching the chart series
Add a regression test asserting that with a provider filter active, the chart datapoint sums match the KPI value for the same range (within rounding epsilon).
Notes
PR #746 documented this as a known limitation in the dashboard.ts comments; this issue tracks the follow-up to actually close the gap.
Summary
The analytics endpoint that backs the Home page Savings-over-time chart accepts an
account_idsfilter but noproviderparam. PR #746 brought chart and KPI cards into account-filter parity, but when the user applies a provider filter (e.g. only AWS, only Azure), the KPIs above the chart correctly scope to the chosen provider while the chart aggregates across all providers — so the numbers drift visibly.Repro
Fix
Add a
provider(orproviders[]for multi-select) query param to the analytics handler. Mirror the same filter semantics as the KPI endpoint so the two sources of truth share the same scoping rules.Suggested touchpoints (verify before editing):
internal/api/handler_dashboard.go(or wherevergetSavingsOverTime/ the analytics route lives)frontend/src/dashboard.ts— passprovideralongsideaccount_idswhen fetching the chart seriesAdd a regression test asserting that with a provider filter active, the chart datapoint sums match the KPI value for the same range (within rounding epsilon).
Notes
PR #746 documented this as a known limitation in the dashboard.ts comments; this issue tracks the follow-up to actually close the gap.