Skip to content

Commit efb475d

Browse files
authored
fix(aci): fix metric detector charts (#103273)
Before: <img width="496" height="202" alt="Screenshot 2025-11-12 at 2 10 37 PM" src="https://github.com/user-attachments/assets/49ed31f8-2008-48b8-9b4f-c9da5c7746ee" /> After: <img width="481" height="177" alt="Screenshot 2025-11-12 at 3 15 02 PM" src="https://github.com/user-attachments/assets/6fc20f83-6a46-4c38-bd01-ba45e791f5e6" />
1 parent b68f5cf commit efb475d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

static/app/views/detectors/components/details/metric/charts/metricDetectorChartOptions.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {Dataset} from 'sentry/views/alerts/rules/metric/types';
1818
import {getAnomalyMarkerSeries} from 'sentry/views/alerts/rules/metric/utils/anomalyChart';
1919
import {isCrashFreeAlert} from 'sentry/views/alerts/rules/metric/utils/isCrashFreeAlert';
2020
import type {Anomaly} from 'sentry/views/alerts/types';
21-
import {IncidentStatus} from 'sentry/views/alerts/types';
2221
import {
2322
ALERT_CHART_MIN_MAX_BUFFER,
2423
alertAxisFormatter,
@@ -248,7 +247,8 @@ export function getMetricDetectorChartOption(
248247
const statusChanges = openPeriod.activities
249248
.filter(
250249
({type, value}) =>
251-
type === 'status_change' && (value === 'medium' || value === 'high')
250+
(type === 'status_change' || type === 'opened') &&
251+
(value === 'medium' || value === 'high')
252252
)
253253
.sort(
254254
(a, b) =>
@@ -257,12 +257,11 @@ export function getMetricDetectorChartOption(
257257

258258
const incidentEnd = openPeriod.end ?? Date.now();
259259

260-
const timeWindowMs = snubaQuery.timeWindow * 60 * 1000;
260+
const timeWindowMs = snubaQuery.timeWindow * 1000;
261261
const incidentColor =
262-
warningCondition &&
263-
statusChanges.some(({value}) => Number(value) === IncidentStatus.CRITICAL)
264-
? theme.red300
265-
: theme.yellow300;
262+
warningCondition && !statusChanges.some(({value}) => value === 'high')
263+
? theme.yellow300
264+
: theme.red300;
266265

267266
const incidentStartDate = new Date(openPeriod.start).getTime();
268267
const incidentCloseDate = openPeriod.end

0 commit comments

Comments
 (0)