From d53e701840a89a9e97dc4c887509ed5af51b7249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 9 Jul 2021 15:42:06 +0200 Subject: [PATCH] Rename log threshold function for consistency --- .../alerting/log_threshold/log_threshold_alert_type.ts | 2 +- x-pack/plugins/infra/public/plugin.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts b/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts index 1ed912964a0f55..44097fd005cc7b 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts +++ b/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts @@ -15,7 +15,7 @@ import { import { formatReason } from './rule_data_formatters'; import { validateExpression } from './validation'; -export function getLogThresholdAlertType(): ObservabilityRuleTypeModel { +export function createLogThresholdAlertType(): ObservabilityRuleTypeModel { return { id: LOG_DOCUMENT_COUNT_ALERT_TYPE_ID, description: i18n.translate('xpack.infra.logs.alertFlyout.alertDescription', { diff --git a/x-pack/plugins/infra/public/plugin.ts b/x-pack/plugins/infra/public/plugin.ts index 38bf04b494998e..d5951d9ec9915c 100644 --- a/x-pack/plugins/infra/public/plugin.ts +++ b/x-pack/plugins/infra/public/plugin.ts @@ -11,7 +11,7 @@ import { from } from 'rxjs'; import { map } from 'rxjs/operators'; import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; import { createInventoryMetricAlertType } from './alerting/inventory'; -import { getLogThresholdAlertType } from './alerting/log_threshold'; +import { createLogThresholdAlertType } from './alerting/log_threshold'; import { createMetricThresholdAlertType } from './alerting/metric_threshold'; import { LOG_STREAM_EMBEDDABLE } from './components/log_stream/log_stream_embeddable'; import { LogStreamEmbeddableFactoryDefinition } from './components/log_stream/log_stream_embeddable_factory'; @@ -35,7 +35,9 @@ export class Plugin implements InfraClientPluginClass { } pluginsSetup.triggersActionsUi.alertTypeRegistry.register(createInventoryMetricAlertType()); - pluginsSetup.observability.observabilityRuleTypeRegistry.register(getLogThresholdAlertType()); + pluginsSetup.observability.observabilityRuleTypeRegistry.register( + createLogThresholdAlertType() + ); pluginsSetup.triggersActionsUi.alertTypeRegistry.register(createMetricThresholdAlertType()); pluginsSetup.observability.dashboard.register({