Skip to content

Commit ee67276

Browse files
committed
Fix tsc, i18n and use constants instead of strings for processor event
1 parent 0d61470 commit ee67276

File tree

8 files changed

+15
-27
lines changed

8 files changed

+15
-27
lines changed

x-pack/plugins/apm/public/components/alerting/fields.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { EuiSelect, EuiExpression, EuiFieldNumber } from '@elastic/eui';
88
import React from 'react';
99
import { i18n } from '@kbn/i18n';
1010
import { EuiSelectOption } from '@elastic/eui';
11-
import { EuiFieldNumberProps } from '@elastic/eui';
1211
import { getEnvironmentLabel } from '../../../common/environment_filter_values';
1312
import { PopoverExpression } from './ServiceAlertTrigger/PopoverExpression';
1413

x-pack/plugins/apm/server/lib/alerts/register_error_count_alert_type.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { schema } from '@kbn/config-schema';
88
import { Observable } from 'rxjs';
99
import { take } from 'rxjs/operators';
10+
import { ProcessorEvent } from '../../../common/processor_event';
1011
import { getEnvironmentUiFilterES } from '../helpers/convert_ui_filters/get_environment_ui_filter_es';
1112
import { AlertType, ALERT_TYPES_CONFIG } from '../../../common/alert_types';
1213
import {
@@ -81,7 +82,7 @@ export function registerErrorCountAlertType({
8182
},
8283
},
8384
},
84-
{ term: { [PROCESSOR_EVENT]: 'error' } },
85+
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.error } },
8586
{ term: { [SERVICE_NAME]: alertParams.serviceName } },
8687
...getEnvironmentUiFilterES(alertParams.environment),
8788
],

x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { schema } from '@kbn/config-schema';
88
import { Observable } from 'rxjs';
99
import { take } from 'rxjs/operators';
10+
import { ProcessorEvent } from '../../../common/processor_event';
1011
import { AlertType, ALERT_TYPES_CONFIG } from '../../../common/alert_types';
1112
import { ESSearchResponse } from '../../../typings/elasticsearch';
1213
import {
@@ -86,7 +87,7 @@ export function registerTransactionDurationAlertType({
8687
},
8788
},
8889
},
89-
{ term: { [PROCESSOR_EVENT]: 'transaction' } },
90+
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } },
9091
{ term: { [SERVICE_NAME]: alertParams.serviceName } },
9192
{ term: { [TRANSACTION_TYPE]: alertParams.transactionType } },
9293
...getEnvironmentUiFilterES(alertParams.environment),

x-pack/plugins/apm/server/lib/alerts/register_transaction_error_rate_alert_type.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { schema } from '@kbn/config-schema';
88
import { Observable } from 'rxjs';
99
import { take } from 'rxjs/operators';
10+
import { ProcessorEvent } from '../../../common/processor_event';
1011
import { EventOutcome } from '../../../common/event_outcome';
1112
import { AlertType, ALERT_TYPES_CONFIG } from '../../../common/alert_types';
1213
import { ESSearchResponse } from '../../../typings/elasticsearch';
@@ -82,7 +83,7 @@ export function registerTransactionErrorRateAlertType({
8283
},
8384
},
8485
},
85-
{ term: { [PROCESSOR_EVENT]: 'transaction' } },
86+
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } },
8687
{ term: { [SERVICE_NAME]: alertParams.serviceName } },
8788
{ term: { [TRANSACTION_TYPE]: alertParams.transactionType } },
8889
...getEnvironmentUiFilterES(alertParams.environment),

x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Logger } from 'kibana/server';
88
import uuid from 'uuid/v4';
99
import { snakeCase } from 'lodash';
1010
import Boom from 'boom';
11+
import { ProcessorEvent } from '../../../common/processor_event';
1112
import { ML_ERRORS } from '../../../common/anomaly_detection';
1213
import { PromiseReturnType } from '../../../../observability/typings/common';
1314
import { Setup } from '../helpers/setup_request';
@@ -79,7 +80,7 @@ async function createAnomalyDetectionJob({
7980
query: {
8081
bool: {
8182
filter: [
82-
{ term: { [PROCESSOR_EVENT]: 'transaction' } },
83+
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } },
8384
{ exists: { field: TRANSACTION_DURATION } },
8485
...getEnvironmentUiFilterES(environment),
8586
],

x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const tasks: TelemetryTask[] = [
8585
query: {
8686
bool: {
8787
filter: [
88-
{ term: { [PROCESSOR_EVENT]: 'transaction' } },
88+
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } },
8989
{ range: { '@timestamp': { gte: start, lt: end } } },
9090
],
9191
},
@@ -606,7 +606,10 @@ export const tasks: TelemetryTask[] = [
606606
timeout,
607607
query: {
608608
bool: {
609-
filter: [{ term: { [PROCESSOR_EVENT]: 'error' } }, range1d],
609+
filter: [
610+
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.error } },
611+
range1d,
612+
],
610613
},
611614
},
612615
aggs: {
@@ -640,7 +643,7 @@ export const tasks: TelemetryTask[] = [
640643
query: {
641644
bool: {
642645
filter: [
643-
{ term: { [PROCESSOR_EVENT]: 'transaction' } },
646+
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } },
644647
range1d,
645648
],
646649
},
@@ -674,7 +677,7 @@ export const tasks: TelemetryTask[] = [
674677
query: {
675678
bool: {
676679
filter: [
677-
{ term: { [PROCESSOR_EVENT]: 'transaction' } },
680+
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } },
678681
range1d,
679682
],
680683
must_not: {

x-pack/plugins/translations/translations/ja-JP.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4676,9 +4676,6 @@
46764676
"xpack.apm.errorGroupDetails.relatedTransactionSample": "関連トランザクションサンプル",
46774677
"xpack.apm.errorGroupDetails.unhandledLabel": "未対応",
46784678
"xpack.apm.errorGroupDetails.viewOccurrencesInDiscoverButtonLabel": "ディスカバリで {occurrencesCount} 件の{occurrencesCount, plural, one {ドキュメント} other {ドキュメント}}を表示。",
4679-
"xpack.apm.errorRateAlertTrigger.environment": "環境",
4680-
"xpack.apm.errorRateAlertTrigger.errors": "エラー",
4681-
"xpack.apm.errorRateAlertTrigger.isAbove": "の下限は",
46824679
"xpack.apm.errorRateChart.avgLabel": "平均",
46834680
"xpack.apm.errorRateChart.rateLabel": "レート",
46844681
"xpack.apm.errorRateChart.title": "トランザクションエラー率",
@@ -4780,9 +4777,6 @@
47804777
"xpack.apm.propertiesTable.tabs.logStacktraceLabel": "スタックトレース",
47814778
"xpack.apm.propertiesTable.tabs.metadataLabel": "メタデータ",
47824779
"xpack.apm.propertiesTable.tabs.timelineLabel": "タイムライン",
4783-
"xpack.apm.registerErrorCountAlertType.variables.serviceName": "サービス名",
4784-
"xpack.apm.registerTransactionDurationAlertType.variables.serviceName": "サービス名",
4785-
"xpack.apm.registerTransactionDurationAlertType.variables.transactionType": "トランザクションタイプ",
47864780
"xpack.apm.rum.dashboard.backend": "バックエンド",
47874781
"xpack.apm.rum.dashboard.frontend": "フロントエンド",
47884782
"xpack.apm.rum.dashboard.overall.label": "全体",
@@ -5029,10 +5023,7 @@
50295023
"xpack.apm.transactionDurationAlert.aggregationType.99th": "99 パーセンタイル",
50305024
"xpack.apm.transactionDurationAlert.aggregationType.avg": "平均",
50315025
"xpack.apm.transactionDurationAlert.name": "トランザクション期間",
5032-
"xpack.apm.transactionDurationAlertTrigger.environment": "環境",
5033-
"xpack.apm.transactionDurationAlertTrigger.isAbove": "の下限は",
50345026
"xpack.apm.transactionDurationAlertTrigger.ms": "ms",
5035-
"xpack.apm.transactionDurationAlertTrigger.type": "タイプ",
50365027
"xpack.apm.transactionDurationAlertTrigger.when": "タイミング",
50375028
"xpack.apm.transactionDurationLabel": "期間",
50385029
"xpack.apm.transactions.chart.95thPercentileLabel": "95 パーセンタイル",

x-pack/plugins/translations/translations/zh-CN.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4677,9 +4677,6 @@
46774677
"xpack.apm.errorGroupDetails.relatedTransactionSample": "相关的事务样本",
46784678
"xpack.apm.errorGroupDetails.unhandledLabel": "未处理",
46794679
"xpack.apm.errorGroupDetails.viewOccurrencesInDiscoverButtonLabel": "在 Discover 查看 {occurrencesCount} 个 {occurrencesCount, plural, one {匹配项} other {匹配项}}。",
4680-
"xpack.apm.errorRateAlertTrigger.environment": "环境",
4681-
"xpack.apm.errorRateAlertTrigger.errors": "错误",
4682-
"xpack.apm.errorRateAlertTrigger.isAbove": "高于",
46834680
"xpack.apm.errorRateChart.avgLabel": "平均",
46844681
"xpack.apm.errorRateChart.rateLabel": "比率",
46854682
"xpack.apm.errorRateChart.title": "事务错误率",
@@ -4783,9 +4780,6 @@
47834780
"xpack.apm.propertiesTable.tabs.logStacktraceLabel": "日志堆栈跟踪",
47844781
"xpack.apm.propertiesTable.tabs.metadataLabel": "元数据",
47854782
"xpack.apm.propertiesTable.tabs.timelineLabel": "时间线",
4786-
"xpack.apm.registerErrorCountAlertType.variables.serviceName": "服务名称",
4787-
"xpack.apm.registerTransactionDurationAlertType.variables.serviceName": "服务名称",
4788-
"xpack.apm.registerTransactionDurationAlertType.variables.transactionType": "事务类型",
47894783
"xpack.apm.rum.dashboard.backend": "后端",
47904784
"xpack.apm.rum.dashboard.frontend": "前端",
47914785
"xpack.apm.rum.dashboard.overall.label": "总体",
@@ -5032,10 +5026,7 @@
50325026
"xpack.apm.transactionDurationAlert.aggregationType.99th": "第 99 个百分位",
50335027
"xpack.apm.transactionDurationAlert.aggregationType.avg": "平均值",
50345028
"xpack.apm.transactionDurationAlert.name": "事务持续时间",
5035-
"xpack.apm.transactionDurationAlertTrigger.environment": "环境",
5036-
"xpack.apm.transactionDurationAlertTrigger.isAbove": "高于",
50375029
"xpack.apm.transactionDurationAlertTrigger.ms": "ms",
5038-
"xpack.apm.transactionDurationAlertTrigger.type": "类型",
50395030
"xpack.apm.transactionDurationAlertTrigger.when": "当",
50405031
"xpack.apm.transactionDurationLabel": "持续时间",
50415032
"xpack.apm.transactions.chart.95thPercentileLabel": "第 95 个百分位",

0 commit comments

Comments
 (0)