Skip to content

Commit

Permalink
[Uptime] Singular alert (elastic#74659)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
shahzad31 and elasticmachine committed Aug 14, 2020
1 parent 4d6592e commit 7cf0e49
Show file tree
Hide file tree
Showing 22 changed files with 1,128 additions and 1,023 deletions.
10 changes: 0 additions & 10 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -18868,10 +18868,6 @@
"xpack.uptime.alerts.anomaly.criteriaExpression.description": "監視するとき",
"xpack.uptime.alerts.anomaly.scoreExpression.ariaLabel": "異常アラートしきい値の条件を表示する式。",
"xpack.uptime.alerts.anomaly.scoreExpression.description": "異常と重要度があります",
"xpack.uptime.alerts.availability.emptyMessage": "可用性しきい値({threshold} %)未満のモニターはありません",
"xpack.uptime.alerts.availability.monitorSummary": "{nameOrId}({url}): {availabilityRatio}%",
"xpack.uptime.alerts.availability.multiItemTitle": "可用性しきい値({threshold} %)未満の上位{monitorCount}個のモニター:\n",
"xpack.uptime.alerts.availability.singleItemTitle": "可用性しきい値({threshold} %)未満のモニター:\n",
"xpack.uptime.alerts.durationAnomaly": "アップタイム期間異常",
"xpack.uptime.alerts.durationAnomaly.actionVariables.state.anomalyStartTimestamp": "異常の開始のISO8601タイムスタンプ",
"xpack.uptime.alerts.durationAnomaly.actionVariables.state.expectedResponseTime": "想定応答時間",
Expand All @@ -18884,11 +18880,6 @@
"xpack.uptime.alerts.durationAnomaly.actionVariables.state.slowestAnomalyResponse": "単位(ミリ秒、秒)が関連付けられた異常バケット中の最も遅い応答時間。",
"xpack.uptime.alerts.durationAnomaly.clientName": "アップタイム期間異常",
"xpack.uptime.alerts.durationAnomaly.defaultActionMessage": "{anomalyStartTimestamp}に、{monitor}、url {monitorUrl}で異常({severity}レベル)応答時間が検出されました。異常重要度スコアは{severityScore}です。\n位置情報{observerLocation}から高い応答時間{slowestAnomalyResponse}が検出されました。想定された応答時間は{expectedResponseTime}です。",
"xpack.uptime.alerts.message.emptyTitle": "停止状況監視 ID を受信していません。",
"xpack.uptime.alerts.message.fullListOverflow": "... とその他 {overflowCount} {pluralizedMonitor}",
"xpack.uptime.alerts.message.multipleTitle": "停止状況監視: ",
"xpack.uptime.alerts.message.overflowBody": "... とその他 {overflowCount} 監視",
"xpack.uptime.alerts.message.singularTitle": "停止状況監視: ",
"xpack.uptime.alerts.monitorStatus": "稼働状況の監視ステータス",
"xpack.uptime.alerts.monitorStatus.actionVariables.context.downMonitorsWithGeo.description": "アラートによって「ダウン」と検知された一部またはすべてのモニターを示す、生成された概要。",
"xpack.uptime.alerts.monitorStatus.actionVariables.context.message.description": "現在ダウンしているモニターを要約する生成されたメッセージ。",
Expand All @@ -18915,7 +18906,6 @@
"xpack.uptime.alerts.monitorStatus.availability.unit.headline": "時間範囲単位を選択します",
"xpack.uptime.alerts.monitorStatus.availability.unit.selectable": "この選択を使用して、このアラートの可用性範囲単位を設定",
"xpack.uptime.alerts.monitorStatus.clientName": "稼働状況の監視ステータス",
"xpack.uptime.alerts.monitorStatus.defaultActionMessage": "{contextMessage}\n前回トリガー日時:{lastTriggered}\n",
"xpack.uptime.alerts.monitorStatus.filterBar.ariaLabel": "監視状態アラートのフィルター基準を許可するインプット",
"xpack.uptime.alerts.monitorStatus.filters.anyLocation": "任意の場所",
"xpack.uptime.alerts.monitorStatus.filters.anyPort": "任意のポート",
Expand Down
10 changes: 0 additions & 10 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -18876,10 +18876,6 @@
"xpack.uptime.alerts.anomaly.criteriaExpression.description": "当监测",
"xpack.uptime.alerts.anomaly.scoreExpression.ariaLabel": "显示异常告警阈值的条件的表达式。",
"xpack.uptime.alerts.anomaly.scoreExpression.description": "具有异常,严重性为",
"xpack.uptime.alerts.availability.emptyMessage": "没有监测低于可用性阈值 ({threshold} %)",
"xpack.uptime.alerts.availability.monitorSummary": "{nameOrId}({url}):{availabilityRatio}%",
"xpack.uptime.alerts.availability.multiItemTitle": "低于可用性阈值 ({threshold} %) 的排名前 {monitorCount} 监测:\n",
"xpack.uptime.alerts.availability.singleItemTitle": "低于可用性阈值 ({threshold} %) 的监测:\n",
"xpack.uptime.alerts.durationAnomaly": "Uptime 持续时间异常",
"xpack.uptime.alerts.durationAnomaly.actionVariables.state.anomalyStartTimestamp": "异常开始的 ISO8601 时间戳。",
"xpack.uptime.alerts.durationAnomaly.actionVariables.state.expectedResponseTime": "预期响应时间",
Expand All @@ -18892,11 +18888,6 @@
"xpack.uptime.alerts.durationAnomaly.actionVariables.state.slowestAnomalyResponse": "在附加单位(ms、s)的异常存储桶期间最慢的响应时间。",
"xpack.uptime.alerts.durationAnomaly.clientName": "Uptime 持续时间异常",
"xpack.uptime.alerts.durationAnomaly.defaultActionMessage": "{anomalyStartTimestamp} 在 url {monitorUrl} 的 {monitor} 上检测到异常({severity} 级别)响应时间。异常严重性分数为 {severityScore}。\n从位置 {observerLocation} 检测到高达 {slowestAnomalyResponse} 的响应时间。预期响应时间为 {expectedResponseTime}。",
"xpack.uptime.alerts.message.emptyTitle": "未接收到已关闭监测 ID",
"xpack.uptime.alerts.message.fullListOverflow": "...以及 {overflowCount} 个其他{pluralizedMonitor}",
"xpack.uptime.alerts.message.multipleTitle": "已关闭监测: ",
"xpack.uptime.alerts.message.overflowBody": "... 以及 {overflowCount} 个其他监测",
"xpack.uptime.alerts.message.singularTitle": "已关闭监测: ",
"xpack.uptime.alerts.monitorStatus": "运行时间监测状态",
"xpack.uptime.alerts.monitorStatus.actionVariables.context.downMonitorsWithGeo.description": "生成的摘要,显示告警已检测为“关闭”的部分或所有监测",
"xpack.uptime.alerts.monitorStatus.actionVariables.context.message.description": "生成的消息,汇总当前关闭的监测",
Expand All @@ -18923,7 +18914,6 @@
"xpack.uptime.alerts.monitorStatus.availability.unit.headline": "选择时间范围单位",
"xpack.uptime.alerts.monitorStatus.availability.unit.selectable": "使用此选择来设置此告警的可用性范围单位",
"xpack.uptime.alerts.monitorStatus.clientName": "运行时间监测状态",
"xpack.uptime.alerts.monitorStatus.defaultActionMessage": "{contextMessage}\n上次触发时间:{lastTriggered}\n",
"xpack.uptime.alerts.monitorStatus.filterBar.ariaLabel": "允许对监测状态告警使用筛选条件的输入",
"xpack.uptime.alerts.monitorStatus.filters.anyLocation": "任意位置",
"xpack.uptime.alerts.monitorStatus.filters.anyPort": "任意端口",
Expand Down
6 changes: 6 additions & 0 deletions x-pack/plugins/uptime/common/runtime_types/ping/ping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ export const makePing = (f: {
ip?: string;
status?: string;
duration?: number;
location?: string;
name?: string;
url?: string;
}): Ping => {
return {
docId: f.docId || 'myDocId',
Expand All @@ -224,7 +227,10 @@ export const makePing = (f: {
ip: f.ip || '127.0.0.1',
status: f.status || 'up',
duration: { us: f.duration || 100000 },
name: f.name,
},
...(f.location ? { observer: { geo: { name: f.location } } } : {}),
...(f.url ? { url: { full: f.url } } : {}),
};
};

Expand Down
17 changes: 17 additions & 0 deletions x-pack/plugins/uptime/common/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,20 @@ export const VALUE_MUST_BE_GREATER_THAN_ZERO = i18n.translate(
export const VALUE_MUST_BE_AN_INTEGER = i18n.translate('xpack.uptime.settings.invalid.nanError', {
defaultMessage: 'Value must be an integer.',
});

export const MonitorStatusTranslations = {
defaultActionMessage: i18n.translate('xpack.uptime.alerts.monitorStatus.defaultActionMessage', {
defaultMessage:
'Monitor {monitorName} with url {monitorUrl} is {statusMessage} from {observerLocation}. The latest error message is {latestErrorMessage}',
values: {
monitorName: '{{state.monitorName}}',
monitorUrl: '{{{state.monitorUrl}}}',
statusMessage: '{{state.statusMessage}}',
latestErrorMessage: '{{{state.latestErrorMessage}}}',
observerLocation: '{{state.observerLocation}}',
},
}),
name: i18n.translate('xpack.uptime.alerts.monitorStatus.clientName', {
defaultMessage: 'Uptime monitor status',
}),
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ describe('monitor status alert type', () => {
).toMatchInlineSnapshot(`
Object {
"alertParamsExpression": [Function],
"defaultActionMessage": "{{context.message}}
Last triggered at: {{state.lastTriggeredAt}}
",
"defaultActionMessage": "Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} is {{state.statusMessage}} from {{state.observerLocation}}. The latest error message is {{{state.latestErrorMessage}}}",
"iconClass": "uptimeApp",
"id": "xpack.uptime.alerts.monitorStatus",
"name": <FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { AlertTypeModel, ValidationResult } from '../../../../triggers_actions_u
import { AlertTypeInitializer } from '.';

import { CLIENT_ALERT_TYPES } from '../../../common/constants/alerts';
import { MonitorStatusTranslations } from './translations';
import { MonitorStatusTranslations } from '../../../common/translations';

const { defaultActionMessage } = MonitorStatusTranslations;

Expand Down
13 changes: 0 additions & 13 deletions x-pack/plugins/uptime/public/lib/alert_types/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@

import { i18n } from '@kbn/i18n';

export const MonitorStatusTranslations = {
defaultActionMessage: i18n.translate('xpack.uptime.alerts.monitorStatus.defaultActionMessage', {
defaultMessage: '{contextMessage}\nLast triggered at: {lastTriggered}\n',
values: {
contextMessage: '{{context.message}}',
lastTriggered: '{{state.lastTriggeredAt}}',
},
}),
name: i18n.translate('xpack.uptime.alerts.monitorStatus.clientName', {
defaultMessage: 'Uptime monitor status',
}),
};

export const TlsTranslations = {
defaultActionMessage: i18n.translate('xpack.uptime.alerts.tls.defaultActionMessage', {
defaultMessage: `Detected {count} TLS certificates expiring or becoming too old.
Expand Down
Loading

0 comments on commit 7cf0e49

Please sign in to comment.