Skip to content

Commit

Permalink
[Synthetics] Update alert condition text (elastic#170013)
Browse files Browse the repository at this point in the history
## Summary

Fixes elastic#168727
  • Loading branch information
shahzad31 authored Oct 30, 2023
1 parent 9a68094 commit d1c587f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -39373,4 +39373,4 @@
"xpack.painlessLab.walkthroughButtonLabel": "Présentation",
"xpack.serverlessObservability.nav.getStarted": "Démarrer"
}
}
}
2 changes: 1 addition & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -39364,4 +39364,4 @@
"xpack.painlessLab.walkthroughButtonLabel": "実地検証",
"xpack.serverlessObservability.nav.getStarted": "使ってみる"
}
}
}
2 changes: 1 addition & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -39358,4 +39358,4 @@
"xpack.painlessLab.walkthroughButtonLabel": "指导",
"xpack.serverlessObservability.nav.getStarted": "开始使用"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const mockStatusAlertDocument = (
return {
fields: {
...mockCommonAlertDocumentFields(monitor.monitorInfo),
[ALERT_REASON]: `Monitor "First" from ${monitor.monitorInfo.observer?.geo?.name} failed ${count} times in the last ${interval}. Alert when > ${numTimes}. Checked at ${checkedAt}.`,
[ALERT_REASON]: `Monitor "First" from ${monitor.monitorInfo.observer?.geo?.name} failed ${count} times in the last ${interval}. Alert when >= ${numTimes}. Checked at ${checkedAt}.`,
},
id: getInstanceId(
monitorInfo,
Expand Down Expand Up @@ -293,8 +293,8 @@ describe('status check alert', () => {
"monitorUrl": "localhost:8080",
"observerHostname": undefined,
"observerLocation": "harrisburg",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 15 mins. Alert when > 5. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 15 mins. Alert when > 5.",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 15 mins. Alert when >= 5. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 15 mins. Alert when >= 5.",
},
]
`);
Expand All @@ -312,8 +312,8 @@ describe('status check alert', () => {
"monitorUrl": "localhost:8080",
"observerHostname": undefined,
"observerLocation": "harrisburg",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 15 mins. Alert when > 5. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 15 mins. Alert when > 5.",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 15 mins. Alert when >= 5. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 15 mins. Alert when >= 5.",
"viewInAppUrl": "http://localhost:5601/hfe/app/uptime/monitor/Zmlyc3Q=?dateRangeEnd=now&dateRangeStart=2022-03-17T13%3A13%3A33.755Z&filters=%5B%5B%22observer.geo.name%22%2C%5B%22harrisburg%22%5D%5D%5D",
},
]
Expand Down Expand Up @@ -375,8 +375,8 @@ describe('status check alert', () => {
"monitorUrl": "localhost:8080",
"observerHostname": undefined,
"observerLocation": "harrisburg",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 15m. Alert when > 5. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 15m. Alert when > 5.",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 15m. Alert when >= 5. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 15m. Alert when >= 5.",
},
]
`);
Expand All @@ -394,8 +394,8 @@ describe('status check alert', () => {
"monitorUrl": "localhost:8080",
"observerHostname": undefined,
"observerLocation": "harrisburg",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 15m. Alert when > 5. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 15m. Alert when > 5.",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 15m. Alert when >= 5. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 15m. Alert when >= 5.",
"viewInAppUrl": "http://localhost:5601/hfe/app/uptime/monitor/Zmlyc3Q=?dateRangeEnd=now&dateRangeStart=2022-03-17T13%3A13%3A33.755Z&filters=%5B%5B%22observer.geo.name%22%2C%5B%22harrisburg%22%5D%5D%5D",
},
]
Expand Down Expand Up @@ -448,8 +448,8 @@ describe('status check alert', () => {
"monitorUrl": "localhost:8080",
"observerHostname": undefined,
"observerLocation": "harrisburg",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 14h. Alert when > 4. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 14h. Alert when > 4.",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 14h. Alert when >= 4. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 14h. Alert when >= 4.",
},
]
`);
Expand Down Expand Up @@ -665,8 +665,8 @@ describe('status check alert', () => {
"monitorUrl": "localhost:8080",
"observerHostname": undefined,
"observerLocation": "harrisburg",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 15 mins. Alert when > 3. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 15 mins. Alert when > 3.",
"reason": "Monitor \\"First\\" from harrisburg failed 234 times in the last 15 mins. Alert when >= 3. Checked at July 6, 2020 9:14 PM.",
"statusMessage": "failed 234 times in the last 15 mins. Alert when >= 3.",
},
]
`);
Expand Down Expand Up @@ -1476,7 +1476,7 @@ describe('status check alert', () => {
numTimes: 10,
interval: '30 days',
})
).toMatchInlineSnapshot(`"failed 235 times in the last 30 days. Alert when > 10."`);
).toMatchInlineSnapshot(`"failed 235 times in the last 30 days. Alert when >= 10."`);
});

it('creates message for availability item', () => {
Expand Down Expand Up @@ -1539,7 +1539,7 @@ describe('status check alert', () => {
}
)
).toMatchInlineSnapshot(
`"failed 235 times in the last 30 days. Alert when > 10. The 5 mins availability is 58.04%. Alert when < 90%."`
`"failed 235 times in the last 30 days. Alert when >= 10. The 5 mins availability is 58.04%. Alert when < 90%."`
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ export const durationAnomalyTranslations = {
export const statusCheckTranslations = {
downMonitorsLabel: (count: number, interval: string, numTimes: number) =>
i18n.translate('xpack.uptime.alerts.monitorStatus.actionVariables.down', {
defaultMessage: `failed {count} times in the last {interval}. Alert when > {numTimes}.`,
defaultMessage: `failed {count} times in the last {interval}. Alert when >= {numTimes}.`,
values: {
count,
interval,
Expand Down

0 comments on commit d1c587f

Please sign in to comment.