diff --git a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_fetch_active_alerts.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_fetch_active_alerts.ts
index ee00905ec7bd7..891c2f737b35a 100644
--- a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_fetch_active_alerts.ts
+++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_fetch_active_alerts.ts
@@ -52,6 +52,11 @@ export function useFetchActiveAlerts() {
'location.id': selectedLocation?.id,
},
},
+ {
+ term: {
+ 'kibana.alert.status': 'active',
+ },
+ },
],
},
},
@@ -62,6 +67,6 @@ export function useFetchActiveAlerts() {
return {
loading,
data,
- numberOfAlerts: data?.hits?.total.value ?? 0,
+ numberOfActiveAlerts: data?.hits?.total.value ?? 0,
};
}
diff --git a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/alerts_icon.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/alerts_icon.tsx
index 930c351b383d6..8dd91bef9627b 100644
--- a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/alerts_icon.tsx
+++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/alerts_icon.tsx
@@ -9,7 +9,9 @@ import { EuiBadge } from '@elastic/eui';
import { useFetchActiveAlerts } from '../hooks/use_fetch_active_alerts';
export const MonitorAlertsIcon = () => {
- const { numberOfAlerts } = useFetchActiveAlerts();
+ const { numberOfActiveAlerts } = useFetchActiveAlerts();
- return numberOfAlerts > 0 ? {numberOfAlerts} : null;
+ return numberOfActiveAlerts > 0 ? (
+ {numberOfActiveAlerts}
+ ) : null;
};