From be95b8d0719c6b1558def35433d576d3b89247e2 Mon Sep 17 00:00:00 2001 From: Alex Fedotyev <61838744+alex-fedotyev@users.noreply.github.com> Date: Tue, 24 Nov 2026 15:50:22 +0000 Subject: [PATCH] feat(app): SLO alerts on the Alerts page SLO burn alerts now read as such on the Alerts page: the source shows as "SLO" with the SLO page's icon, the rule shows as "Fast burn: if 2% of the error budget is spent within 1 hour", and the alert's name, the source link and "Edit" open its SLO, where its settings and history live. Deleting one says which burn alert of which SLO goes, and that the SLO keeps tracking. An SLO alert's detail page redirects to its SLO, and the source filter only offers SLO when SLOs are enabled. The shared alert types get the SLO source and, for SLO alerts, the SLO and the rule. Co-Authored-By: Claude Opus 5.5 --- packages/app/src/AlertDetailPage.tsx | 13 ++- .../src/components/alerts/AlertDetails.tsx | 14 +++- .../alerts/AlertPropertiesSummary.tsx | 25 ++++-- .../src/components/alerts/AlertRowMenu.tsx | 52 +++++++++--- .../__tests__/AlertPropertiesSummary.test.tsx | 39 ++++++++- .../alerts/__tests__/AlertRowMenu.test.tsx | 82 ++++++++++++++++++- .../app/src/utils/__tests__/alerts.test.ts | 13 +++ packages/app/src/utils/alerts.ts | 12 ++- packages/common-utils/src/types.ts | 6 ++ 9 files changed, 225 insertions(+), 31 deletions(-) diff --git a/packages/app/src/AlertDetailPage.tsx b/packages/app/src/AlertDetailPage.tsx index e62115eaa2..30a4046a80 100644 --- a/packages/app/src/AlertDetailPage.tsx +++ b/packages/app/src/AlertDetailPage.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import Head from 'next/head'; import Link from 'next/link'; import { useRouter } from 'next/router'; -import { AlertInterval } from '@hyperdx/common-utils/dist/types'; +import { AlertInterval, AlertSource } from '@hyperdx/common-utils/dist/types'; import { ActionIcon, Anchor, @@ -27,7 +27,7 @@ import { AlertStateBadge } from '@/components/alerts/AlertStateBadge'; import EmptyState from '@/components/EmptyState'; import { PageHeader } from '@/components/PageHeader'; import { TimePicker } from '@/components/TimePicker'; -import { IS_ALERT_DETAILS_ENABLED } from '@/config'; +import { IS_ALERT_DETAILS_ENABLED, IS_SLOS_ENABLED } from '@/config'; import { getAlertSourceLabel, getAlertSourceUrl } from '@/utils/alerts'; import api from './api'; @@ -237,6 +237,15 @@ export default function AlertDetailPage() { const { data, isLoading, isError } = api.useAlert(alertId); const alert = data?.data; + + // An SLO's alert is shown, and changed, on its SLO. + const sloId = + IS_SLOS_ENABLED && alert?.source === AlertSource.SLO + ? alert.sloId + : undefined; + React.useEffect(() => { + if (sloId) router.replace(`/slos/${sloId}`); + }, [sloId, router]); const title = usePageTitle( alert ? `${alert.displayName} - Alerts` : 'Alerts', ); diff --git a/packages/app/src/components/alerts/AlertDetails.tsx b/packages/app/src/components/alerts/AlertDetails.tsx index e8ba7737c5..25d42b9de7 100644 --- a/packages/app/src/components/alerts/AlertDetails.tsx +++ b/packages/app/src/components/alerts/AlertDetails.tsx @@ -20,6 +20,7 @@ import { IconHelpCircle, IconNote, IconTableRow, + IconTargetArrow, } from '@tabler/icons-react'; import { AckAlert } from '@/components/alerts/AckAlert'; @@ -27,7 +28,7 @@ import { AlertHistoryCardList } from '@/components/alerts/AlertHistoryCards'; import { AlertPropertiesSummary } from '@/components/alerts/AlertPropertiesSummary'; import { AlertRowMenu } from '@/components/alerts/AlertRowMenu'; import { AlertStateBadge } from '@/components/alerts/AlertStateBadge'; -import { IS_ALERT_DETAILS_ENABLED } from '@/config'; +import { IS_ALERT_DETAILS_ENABLED, IS_SLOS_ENABLED } from '@/config'; import type { AlertsPageItem } from '@/types'; import { getAlertSourceLabel, getAlertSourceUrl } from '@/utils/alerts'; @@ -114,6 +115,8 @@ export const AlertDetails = React.memo(function AlertDetails({ // Matches the chart explorer's nav icon: an inline alert's query is // authored and reopened there. return