Alerting: Display "Show all" button for cloud rules (#79512)

* Fix counting totals for cloud rules

* Address PR review
This commit is contained in:
Virginia Cepeda 2023-12-15 12:08:16 -03:00 committed by GitHub
parent 9dc015b595
commit 3e4abdeb18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -275,11 +275,11 @@ export function calculateRuleTotals(rule: Pick<AlertingRule, 'alerts' | 'totals'
} }
return { return {
alerting: result[AlertInstanceTotalState.Alerting], alerting: result[AlertInstanceTotalState.Alerting] || result['firing'],
pending: result[AlertInstanceTotalState.Pending], pending: result[AlertInstanceTotalState.Pending],
inactive: result[AlertInstanceTotalState.Normal], inactive: result[AlertInstanceTotalState.Normal],
nodata: result[AlertInstanceTotalState.NoData], nodata: result[AlertInstanceTotalState.NoData],
error: result[AlertInstanceTotalState.Error] + result['err'], // Prometheus uses "err" instead of "error" error: result[AlertInstanceTotalState.Error] || result['err'] || undefined, // Prometheus uses "err" instead of "error"
}; };
} }