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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface AlertStatusMetaData {
status: string;
locationId: string;
timestamp: string;
ping: t.TypeOf<typeof OverviewPingCodec>;
latestPing: t.TypeOf<typeof OverviewPingCodec>;
checks: {
downWithinXChecks: number;
down: number;
Expand Down Expand Up @@ -92,7 +92,7 @@ export interface AlertPendingStatusMetaData {
locationId: string;
monitorInfo: MissingPingMonitorInfo;
timestamp?: string;
ping?: t.TypeOf<typeof OverviewPingCodec>;
latestPing?: t.TypeOf<typeof OverviewPingCodec>;
}

export interface AlertOverviewStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe('setRecoveredAlertsContext', () => {
monitorQueryId: 'stale-config',
status: 'up',
locationId: '',
ping: {
latestPing: {
'@timestamp': new Date().toISOString(),
state: {
ends: {
Expand All @@ -219,7 +219,7 @@ describe('setRecoveredAlertsContext', () => {
name: location,
},
},
} as StaleDownConfig['ping'],
} as StaleDownConfig['latestPing'],
timestamp: new Date().toISOString(),
checks: {
downWithinXChecks: 1,
Expand Down Expand Up @@ -260,7 +260,7 @@ describe('setRecoveredAlertsContext', () => {
monitorQueryId: 'stale-config',
status: 'down',
locationId: 'location',
ping: {
latestPing: {
'@timestamp': new Date().toISOString(),
state: {
id: '123456',
Expand All @@ -273,7 +273,7 @@ describe('setRecoveredAlertsContext', () => {
name: location,
},
},
} as StaleDownConfig['ping'],
} as StaleDownConfig['latestPing'],
timestamp: new Date().toISOString(),
isDeleted: true,
checks: {
Expand Down Expand Up @@ -350,7 +350,7 @@ describe('setRecoveredAlertsContext', () => {
monitorQueryId: 'stale-config',
status: 'down',
locationId: 'location',
ping: {
latestPing: {
'@timestamp': new Date().toISOString(),
state: {
id: '123456',
Expand All @@ -363,7 +363,7 @@ describe('setRecoveredAlertsContext', () => {
name: 'us_west',
},
},
} as StaleDownConfig['ping'],
} as StaleDownConfig['latestPing'],
timestamp: new Date().toISOString(),
isLocationRemoved: true,
checks: {
Expand Down Expand Up @@ -440,15 +440,15 @@ describe('setRecoveredAlertsContext', () => {
monitorQueryId: 'stale-config',
status: 'down',
locationId: location,
ping: {
latestPing: {
state: {
id: '123456',
},
'@timestamp': new Date().toISOString(),
monitor: {
name: 'test-monitor',
},
} as StaleDownConfig['ping'],
} as StaleDownConfig['latestPing'],
timestamp: new Date().toISOString(),
isLocationRemoved: true,
checks: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export const getDeletedMonitorOrLocationSummary = ({
params?: StatusRuleParams;
}) => {
const config = staleConfigs[recoveredAlertId];
const monitorInfo = 'monitorInfo' in config ? config.monitorInfo : config.ping;
const monitorInfo = 'monitorInfo' in config ? config.monitorInfo : config.latestPing;
const monitorSummary = getMonitorSummary({
monitorInfo,
reason: 'recovered',
Expand Down Expand Up @@ -462,7 +462,7 @@ export const getUpMonitorRecoverySummary = ({

const upConfig = upConfigs[recoveredAlertId];
const isUp = Boolean(upConfig) || false;
const ping = upConfig.ping;
const ping = upConfig.latestPing;

const monitorSummary = getMonitorSummary({
monitorInfo: ping,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ describe('message_utils', () => {
configId: monitorId,
monitorQueryId: monitorId,
locationId,
ping: {
latestPing: {
observer: {
geo: {
name: locationName,
Expand All @@ -185,7 +185,7 @@ describe('message_utils', () => {
configId: monitorId,
monitorQueryId: monitorId,
locationId: secondLocationId,
ping: {
latestPing: {
observer: {
geo: {
name: secondLocationName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export const getUngroupedReasonMessage = ({
'{downCount} {downCount, plural, one {time} other {times}} from {locName}',
values: {
locName:
c.ping?.observer.geo?.name ||
c.latestPing?.observer.geo?.name ||
('monitorInfo' in c && c.monitorInfo.observer.geo.name) ||
c.locationId,
downCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export async function queryMonitorStatusAlert({
});

const meta: AlertStatusMetaData = {
ping: latestPing,
latestPing,
configId,
monitorQueryId,
locationId: monLocationId,
Expand Down
Loading