MD-Mushfiqur123 opened a new pull request, #67549:
URL: https://github.com/apache/airflow/pull/67549
## Problem
The dashboard "Historical Metrics" section shows incorrect percentages
because the API endpoint `/ui/dashboard/historical_metrics_data` caps per-state
counts at `STATE_COUNT_CAP = 1000` (for performance), but the frontend computes
the total as the sum of these capped values and uses it as the denominator for
percentage calculations.
For example, if `success` has 100,000 task instances and every other state
has 0, the API returns `success: 1000` (capped) while all others are 0. The
frontend computes `total = 1000` and shows `success: 100%`. With many states
hitting the cap, the total itself is wrong and percentages are meaningless.
## Fix
Return the real uncapped total counts (`dag_run_total_count` and
`task_instance_total_count`) alongside the existing capped per-state counts.
The frontend now uses these uncapped totals as the denominator for percentage
and progress-bar computations.
This is a minimal, backward-compatible change that:
- Adds two `COUNT(*)` queries (fast aggregate queries with the same filters)
- Adds two fields to the API response
- Updates the frontend to use the uncapped totals instead of summing capped
values
- Preserves the existing capped display behavior ("N+" indicator, bar
expansion, percentage hiding) when a state hits the limit
Closes #67336
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]