diff --git a/.changeset/enable-alert-details-everywhere.md b/.changeset/enable-alert-details-everywhere.md new file mode 100644 index 000000000..280187cf6 --- /dev/null +++ b/.changeset/enable-alert-details-everywhere.md @@ -0,0 +1,8 @@ +--- +'@hyperdx/app': minor +--- + +feat: enable the alert details page (`/alerts/:id`) in all deployments. Removes +the `NEXT_PUBLIC_ENABLE_ALERT_DETAILS` flag that previously gated it, so private, +OSS, and LogHouse environments now get the same alert details page already +enabled in cloud. diff --git a/docker-compose.yml b/docker-compose.yml index 4e9530d0c..74bce4992 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -86,8 +86,6 @@ services: # Uncomment the next two lines to enable PromQL (Prometheus-compatible metrics) # ENABLE_PROMQL: 'true' # NEXT_PUBLIC_ENABLE_PROMQL: 'true' - # Uncomment to enable the alert detail page (in development) - # NEXT_PUBLIC_ENABLE_ALERT_DETAILS: 'true' # Uncomment and set to append a label to the browser tab title, e.g. # for operators running multiple instances (produces "HyperDX UK") # NEXT_PUBLIC_INSTANCE_LABEL: 'UK' diff --git a/packages/app/.env.development b/packages/app/.env.development index af4a79ce0..7fd59cdfd 100644 --- a/packages/app/.env.development +++ b/packages/app/.env.development @@ -13,4 +13,3 @@ NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:${HDX_DEV_OTEL_HTTP_PO # NEXT_PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT= # NEXT_PUBLIC_OTEL_EXPORTER_OTLP_LOGS_ENDPOINT= NEXT_PUBLIC_ENABLE_PROMQL=true -NEXT_PUBLIC_ENABLE_ALERT_DETAILS=true diff --git a/packages/app/playwright.config.ts b/packages/app/playwright.config.ts index b0078376a..9c426b496 100644 --- a/packages/app/playwright.config.ts +++ b/packages/app/playwright.config.ts @@ -114,8 +114,8 @@ export default defineConfig({ { // Full UI: Alerts + Dashboards. Not local mode; Alerts enabled; command: USE_DEV - ? `${NO_SELF_TELEMETRY} SERVER_URL=http://localhost:${API_PORT} PORT=${APP_PORT} NEXT_DIST_DIR=.next-e2e NEXT_PUBLIC_ENABLE_ALERT_DETAILS=true NEXT_PUBLIC_ENABLE_PROMQL=true next dev --webpack` - : `${NO_SELF_TELEMETRY} SERVER_URL=http://localhost:${API_PORT} PORT=${APP_PORT} NEXT_DIST_DIR=.next-e2e NEXT_PUBLIC_ENABLE_ALERT_DETAILS=true NEXT_PUBLIC_ENABLE_PROMQL=true yarn build && ${NO_SELF_TELEMETRY} SERVER_URL=http://localhost:${API_PORT} PORT=${APP_PORT} NEXT_DIST_DIR=.next-e2e NEXT_PUBLIC_ENABLE_ALERT_DETAILS=true NEXT_PUBLIC_ENABLE_PROMQL=true yarn start`, + ? `${NO_SELF_TELEMETRY} SERVER_URL=http://localhost:${API_PORT} PORT=${APP_PORT} NEXT_DIST_DIR=.next-e2e NEXT_PUBLIC_ENABLE_PROMQL=true next dev --webpack` + : `${NO_SELF_TELEMETRY} SERVER_URL=http://localhost:${API_PORT} PORT=${APP_PORT} NEXT_DIST_DIR=.next-e2e NEXT_PUBLIC_ENABLE_PROMQL=true yarn build && ${NO_SELF_TELEMETRY} SERVER_URL=http://localhost:${API_PORT} PORT=${APP_PORT} NEXT_DIST_DIR=.next-e2e NEXT_PUBLIC_ENABLE_PROMQL=true yarn start`, port: parseInt(APP_PORT, 10), reuseExistingServer: !process.env.CI, timeout: APP_SERVER_STARTUP_TIMEOUT_MS, diff --git a/packages/app/src/AlertDetailPage.tsx b/packages/app/src/AlertDetailPage.tsx index e62115eaa..a5fb90925 100644 --- a/packages/app/src/AlertDetailPage.tsx +++ b/packages/app/src/AlertDetailPage.tsx @@ -27,7 +27,6 @@ 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 { getAlertSourceLabel, getAlertSourceUrl } from '@/utils/alerts'; import api from './api'; @@ -227,24 +226,12 @@ export default function AlertDetailPage() { const alertId = typeof router.query.alertId === 'string' ? router.query.alertId : undefined; - // Direct-URL guard while the feature bakes: the alerts page only renders - // Details links when the flag is on, but the route itself must bounce too. - React.useEffect(() => { - if (!IS_ALERT_DETAILS_ENABLED) { - router.replace('/alerts'); - } - }, [router]); - const { data, isLoading, isError } = api.useAlert(alertId); const alert = data?.data; const title = usePageTitle( alert ? `${alert.displayName} - Alerts` : 'Alerts', ); - if (!IS_ALERT_DETAILS_ENABLED) { - return null; - } - return (
diff --git a/packages/app/src/__tests__/hdxDebug.test.ts b/packages/app/src/__tests__/hdxDebug.test.ts index 5a6c8ecea..020846047 100644 --- a/packages/app/src/__tests__/hdxDebug.test.ts +++ b/packages/app/src/__tests__/hdxDebug.test.ts @@ -4,7 +4,6 @@ const baseConfig = { APP_VERSION: '9.9.9', BASE_PATH: '', - IS_ALERT_DETAILS_ENABLED: false, IS_CLICKHOUSE_BUILD: false, IS_LLM_COST_ENABLED: false, IS_DEV: false, diff --git a/packages/app/src/components/alerts/AlertDetails.tsx b/packages/app/src/components/alerts/AlertDetails.tsx index e8ba7737c..be18b79c8 100644 --- a/packages/app/src/components/alerts/AlertDetails.tsx +++ b/packages/app/src/components/alerts/AlertDetails.tsx @@ -27,7 +27,6 @@ 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 type { AlertsPageItem } from '@/types'; import { getAlertSourceLabel, getAlertSourceUrl } from '@/utils/alerts'; @@ -146,9 +145,7 @@ export const AlertDetails = React.memo(function AlertDetails({ // "Open " and falls back to its own wording when blank. const linkTitle = alert.source ? sourceLabel : ''; - const nameHref = IS_ALERT_DETAILS_ENABLED - ? `/alerts/${alert._id}` - : alertUrl || undefined; + const nameHref = `/alerts/${alert._id}`; return (
@@ -157,29 +154,20 @@ export const AlertDetails = React.memo(function AlertDetails({
- {/* With alert details enabled, the alert name is the entry point - to its status page; the source tile / saved search moves to a - secondary link on the right. An alert whose source cannot be - resolved — a deleted dashboard, say — has no destination at - all, so its name is plain text rather than a link to nowhere. */} - {nameHref ? ( - - - {alertIcon} - {alertName} - - - ) : ( - + {/* The alert name is the entry point to its details page; the + source tile / saved search moves to a secondary link on the + right. */} + + {alertIcon} {alertName} - )} +
{alert.createdBy && ( @@ -208,7 +196,7 @@ export const AlertDetails = React.memo(function AlertDetails({ diff --git a/packages/app/src/config.ts b/packages/app/src/config.ts index 584b34e62..180723737 100644 --- a/packages/app/src/config.ts +++ b/packages/app/src/config.ts @@ -92,10 +92,6 @@ export const INSTANCE_LABEL = (env('NEXT_PUBLIC_INSTANCE_LABEL') ?? '') // when INSTANCE_LABEL is unset, so `${brandName}${INSTANCE_TITLE_SUFFIX}` is // always safe to write regardless of whether a label is configured. export const INSTANCE_TITLE_SUFFIX = INSTANCE_LABEL ? ` ${INSTANCE_LABEL}` : ''; -// Alert detail page (/alerts/:id). Default off — currently enabled only in -// dev (.env.development) and CI (e2e webserver) while the feature bakes. -export const IS_ALERT_DETAILS_ENABLED = - env('NEXT_PUBLIC_ENABLE_ALERT_DETAILS') === 'true'; // Not exported: IS_IAC_EXPORT_ENABLED below is the only gate callers should // read. Leaving the raw flag importable re-opens the "forgot the local-mode // check" mistake that folding the two together was meant to close. diff --git a/packages/app/src/hdxDebug.ts b/packages/app/src/hdxDebug.ts index 6de699b92..6c38bc5c2 100644 --- a/packages/app/src/hdxDebug.ts +++ b/packages/app/src/hdxDebug.ts @@ -5,7 +5,6 @@ import { APP_VERSION, BASE_PATH, INSTANCE_LABEL, - IS_ALERT_DETAILS_ENABLED, IS_CLICKHOUSE_BUILD, IS_DEV, IS_LLM_COST_ENABLED, @@ -87,7 +86,6 @@ let clickhouseVersions: HdxClickHouseVersion[] = []; const staticFeatures: Record = { promql: IS_PROMQL_ENABLED, llmCost: IS_LLM_COST_ENABLED, - alertDetails: IS_ALERT_DETAILS_ENABLED, instanceLabel: Boolean(INSTANCE_LABEL), };