Skip to content

Commit

Permalink
[Synthetics] adjust alert id for synthetics (#157234)
Browse files Browse the repository at this point in the history
## Summary

Resolves #152773

Uses the `idWithLocation` value as the unique id for a monitor alert.

Given that we use uuid's for monitor config ids, this id should be
unique enough for any given monitor.

## Release note

All monitor status alerts for the Synthetics app that are active at the
time of upgrading will be resolved. A new alert will be created in its
place.
  • Loading branch information
dominiqueclarke authored May 11, 2023
1 parent 4150ca4 commit 1dbf3bb
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
ALERT_DETAILS_URL,
VIEW_IN_APP_URL,
} from '../../legacy_uptime/lib/alerts/action_variables';
import { getInstanceId } from '../../legacy_uptime/lib/alerts/status_check';
import { UMServerLibs } from '../../legacy_uptime/uptime_server';
import { SyntheticsMonitorClient } from '../../synthetics_service/synthetics_monitor/synthetics_monitor_client';
import { UptimeRuleTypeAlertDefinition } from '../../legacy_uptime/lib/alerts/common';
Expand Down Expand Up @@ -92,7 +91,7 @@ export const registerSyntheticsStatusCheckRule = (
Object.entries(downConfigs).forEach(([idWithLocation, { ping, configId }]) => {
const locationId = statusRule.getLocationId(ping.observer?.geo?.name!) ?? '';
const monitorSummary = getMonitorSummary(ping, DOWN_LABEL, locationId, configId);
const alertId = getInstanceId(ping, idWithLocation);
const alertId = idWithLocation;
const alert = alertWithLifecycle({
id: alertId,
fields: getMonitorAlertDocument(monitorSummary),
Expand Down

0 comments on commit 1dbf3bb

Please sign in to comment.