Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/enable-alert-details-everywhere.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 0 additions & 1 deletion packages/app/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions packages/app/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 0 additions & 13 deletions packages/app/src/AlertDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 (
<div
data-testid="alert-detail-page"
Expand Down
7 changes: 1 addition & 6 deletions packages/app/src/DBChartPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { DEFAULT_CHART_CONFIG } from '@/ChartUtils';
import EditTimeChartForm from '@/components/DBEditTimeChartForm';
import { InputControlled } from '@/components/InputControlled';
import { SourceSelectControlled } from '@/components/SourceSelect';
import { IS_ALERT_DETAILS_ENABLED } from '@/config';
import { useChartAssistant } from '@/hooks/ai';
import { useAlertSeededChartConfig } from '@/hooks/useAlertSeededChartConfig';
import { useResolvedSourceParam } from '@/hooks/useResolvedSourceParam';
Expand Down Expand Up @@ -284,11 +283,7 @@ function DBChartExplorerPage() {
Alert created.{' '}
<Anchor
component={Link}
href={
IS_ALERT_DETAILS_ENABLED && created?.id
? `/alerts/${created.id}`
: '/alerts'
}
href={created?.id ? `/alerts/${created.id}` : '/alerts'}
inherit
underline="always"
>
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/__tests__/hdxDebug.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
38 changes: 13 additions & 25 deletions packages/app/src/components/alerts/AlertDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -146,9 +145,7 @@ export const AlertDetails = React.memo(function AlertDetails({
// "Open <source>" 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 (
<div data-testid={`alert-card-${alert._id}`} className={styles.alertRow}>
Expand All @@ -157,29 +154,20 @@ export const AlertDetails = React.memo(function AlertDetails({

<Stack gap={2}>
<div>
{/* 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 ? (
<Link
data-testid={`alert-link-${alert._id}`}
href={nameHref}
className={styles.alertLink}
title={IS_ALERT_DETAILS_ENABLED ? 'Alert details' : linkTitle}
>
<Group gap={2}>
{alertIcon}
{alertName}
</Group>
</Link>
) : (
<Group gap={2} data-testid={`alert-name-${alert._id}`}>
{/* The alert name is the entry point to its details page; the
source tile / saved search moves to a secondary link on the
right. */}
<Link
data-testid={`alert-link-${alert._id}`}
href={nameHref}
className={styles.alertLink}
title="Alert details"
>
<Group gap={2}>
{alertIcon}
{alertName}
</Group>
)}
</Link>
</div>
<AlertPropertiesSummary alert={alert} />
{alert.createdBy && (
Expand Down Expand Up @@ -208,7 +196,7 @@ export const AlertDetails = React.memo(function AlertDetails({
</Flex>
<AlertRowMenu
alert={alert}
alertUrl={IS_ALERT_DETAILS_ENABLED ? alertUrl : undefined}
alertUrl={alertUrl}
linkTitle={linkTitle}
alertName={alert.displayName}
/>
Expand Down
4 changes: 0 additions & 4 deletions packages/app/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/hdxDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
APP_VERSION,
BASE_PATH,
INSTANCE_LABEL,
IS_ALERT_DETAILS_ENABLED,
IS_CLICKHOUSE_BUILD,
IS_DEV,
IS_LLM_COST_ENABLED,
Expand Down Expand Up @@ -87,7 +86,6 @@ let clickhouseVersions: HdxClickHouseVersion[] = [];
const staticFeatures: Record<string, boolean> = {
promql: IS_PROMQL_ENABLED,
llmCost: IS_LLM_COST_ENABLED,
alertDetails: IS_ALERT_DETAILS_ENABLED,
instanceLabel: Boolean(INSTANCE_LABEL),
};

Expand Down
Loading