Skip to content

Commit

Permalink
mgr/dashboard: Filter active alerts
Browse files Browse the repository at this point in the history
- List alerts which are not suppressed

fixes: https://tracker.ceph.com/issues/62990

Signed-off-by: cloudbehl <[email protected]>
  • Loading branch information
cloudbehl committed Oct 5, 2023
1 parent db8fb4d commit a40fd8c
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -299,7 +299,9 @@
<ng-template #alertsCard>
<ng-container *ngFor="let alert of prometheusAlertService.alerts; let i = index; trackBy: trackByFn">
<div [ngClass]="['border-'+alertClass[alert.labels.severity]]"
*ngIf="alert.labels.severity === alertType || !alertType">
*ngIf="alert.status.state === 'active' &&
alert.labels.severity === alertType ||
!alertType">
<div class="card tc_alerts border-0 pt-3">
<div class="row no-gutters ps-2">
<div class="col-sm-1 text-center">
Original file line number Diff line number Diff line change
@@ -80,9 +80,9 @@ export class PrometheusAlertService {
alert.status.state === 'active' && alert.labels.severity === 'warning' ? ++result : result,
0
);
this.alerts = alerts.reverse().sort((a, b) => {
return a.labels.severity.localeCompare(b.labels.severity);
});
this.alerts = alerts
.reverse()
.sort((a, b) => a.labels.severity.localeCompare(b.labels.severity));
this.canAlertsBeNotified = true;
}

0 comments on commit a40fd8c

Please sign in to comment.