The ActiveAlerts component provides a summarized view of currently firing or acknowledged alerts across the Kubernetes fleet. It gives operators immediate visibility into ongoing critical and warning-level events, offering quick actions to drill down into specifics, trigger AI diagnoses, or launch guided missions to resolve the issues.
- Hooks used:
useAlerts(fetches active/acknowledged alerts & stats),useGlobalFilters(severity and custom text filters),useMissions(mission tracking),useDrillDownActions(navigation),useCardData(search, sort, pagination wrapper),useCardLoadingState, anduseDemoMode. - Backend APIs or streams: Data provided dynamically through
useAlerts, which abstracts the underlying REST/SSE feeds. - Data provider: Backend / Local Agent / Demo mode (handled seamlessly via
useDemoMode).
| Prop | Type | Default | Description |
|---|---|---|---|
| (None) | N/A | N/A | This component is self-contained and retrieves all required state via context and custom hooks. |
- Loading: Handled globally by broadcasting status using the
useCardLoadingStatehook to the parentCardWrapper. - Empty: Renders a "No Active Alerts / All systems operational" empty state with a green checkmark when zero alerts match the active filters.
- Error: Handled at a higher level by
DynamicCardErrorBoundaryor graceful degradation within the hooks.
- Filtering / sorting / pagination:
- Combines active and optionally acknowledged alerts based on a local toggle.
- Pre-filters combined data utilizing global states (
selectedSeveritiesandcustomFiltertext). - Relies on the standard
useCardDatarobust hook for local pagination, cluster filtering, and sorting byseverityortime.
- Data transformation or aggregation:
- Maps individual alert
AlertSeverityto globalSeverityLevelstrings to match the top-bar filter context. - Extracts totals to power the top
AlertStatsRowcomponent (showing critical, warning, and acknowledged summary counts).
- Maps individual alert
- Special logic:
- Allows triggering
runAIDiagnosis(alertId)to initiate local agent troubleshooting. - Connects to the Mission sidebar via
setActiveMission(mission.id). - Pushes context cleanly via
drillToAlert()when a specific alert list item is clicked.
- Allows triggering
- Edge cases: The filtering logic assumes
AlertSeveritymatches limited types. If a new severity level is introduced on the backend, themapAlertSeverityToGlobalswitch statement must be updated to avoid defaulting toinfo.