From bdfec09fdc6448cda5910c70224fb49eb2ee88e7 Mon Sep 17 00:00:00 2001 From: Janki Salvi Date: Tue, 17 Dec 2024 17:56:56 +0000 Subject: [PATCH 01/15] initial commit --- .../rule_params/apm_anomaly/index.ts | 14 +++ .../rule_params/apm_anomaly/latest.ts | 10 ++ .../rule_params/apm_anomaly/v1.ts | 40 ++++++++ .../common/search_configuration_schema.ts | 19 ++++ .../rule_params/error_count/index.ts | 14 +++ .../rule_params/error_count/latest.ts | 10 ++ .../rule_params/error_count/v1.ts | 25 +++++ .../rule_params/transaction_duration/index.ts | 5 + .../transaction_duration/latest.ts | 10 ++ .../rule_params/transaction_duration/v1.ts | 37 +++++++ .../transaction_error_rate/index.ts | 14 +++ .../transaction_error_rate/latest.ts | 10 ++ .../rule_params/transaction_error_rate/v1.ts | 26 +++++ .../response-ops/rule_params/tsconfig.json | 17 +--- packages/response-ops/rule_params/v1.ts | 16 ++- .../apm/common/rules/schema.ts | 97 ------------------- .../error_count_rule_type/index.tsx | 2 +- .../transaction_duration_rule_type/index.tsx | 2 +- .../index.tsx | 2 +- .../anomaly/register_anomaly_rule_type.ts | 12 ++- .../register_error_count_rule_type.ts | 6 +- ...register_transaction_duration_rule_type.ts | 9 +- ...gister_transaction_error_rate_rule_type.ts | 9 +- .../services/alerting_api.ts | 13 ++- .../alerts/helpers/alerting_api_helper.ts | 12 ++- 25 files changed, 291 insertions(+), 140 deletions(-) create mode 100644 packages/response-ops/rule_params/apm_anomaly/index.ts create mode 100644 packages/response-ops/rule_params/apm_anomaly/latest.ts create mode 100644 packages/response-ops/rule_params/apm_anomaly/v1.ts create mode 100644 packages/response-ops/rule_params/common/search_configuration_schema.ts create mode 100644 packages/response-ops/rule_params/error_count/index.ts create mode 100644 packages/response-ops/rule_params/error_count/latest.ts create mode 100644 packages/response-ops/rule_params/error_count/v1.ts create mode 100644 packages/response-ops/rule_params/transaction_duration/index.ts create mode 100644 packages/response-ops/rule_params/transaction_duration/latest.ts create mode 100644 packages/response-ops/rule_params/transaction_duration/v1.ts create mode 100644 packages/response-ops/rule_params/transaction_error_rate/index.ts create mode 100644 packages/response-ops/rule_params/transaction_error_rate/latest.ts create mode 100644 packages/response-ops/rule_params/transaction_error_rate/v1.ts delete mode 100644 x-pack/plugins/observability_solution/apm/common/rules/schema.ts diff --git a/packages/response-ops/rule_params/apm_anomaly/index.ts b/packages/response-ops/rule_params/apm_anomaly/index.ts new file mode 100644 index 0000000000000..d85095e183062 --- /dev/null +++ b/packages/response-ops/rule_params/apm_anomaly/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export { apmAnomalyParamsSchema } from './latest'; +export { apmAnomalyParamsSchema as apmAnomalyParamsSchemaV1 } from './v1'; + +export type { ApmAnomalyRuleTypeParams } from './latest'; +export type { ApmAnomalyRuleTypeParams as ApmAnomalyRuleTypeParamsV1 } from './v1'; diff --git a/packages/response-ops/rule_params/apm_anomaly/latest.ts b/packages/response-ops/rule_params/apm_anomaly/latest.ts new file mode 100644 index 0000000000000..f278309c22b03 --- /dev/null +++ b/packages/response-ops/rule_params/apm_anomaly/latest.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './v1'; diff --git a/packages/response-ops/rule_params/apm_anomaly/v1.ts b/packages/response-ops/rule_params/apm_anomaly/v1.ts new file mode 100644 index 0000000000000..4bba73efa27a4 --- /dev/null +++ b/packages/response-ops/rule_params/apm_anomaly/v1.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { TypeOf, schema } from '@kbn/config-schema'; +import { ML_ANOMALY_SEVERITY } from '@kbn/ml-anomaly-utils/anomaly_severity'; + +export enum AnomalyDetectorType { + txLatency = 'txLatency', + txThroughput = 'txThroughput', + txFailureRate = 'txFailureRate', +} + +const detectorsSchema = schema.oneOf([ + schema.literal(AnomalyDetectorType.txLatency), + schema.literal(AnomalyDetectorType.txThroughput), + schema.literal(AnomalyDetectorType.txFailureRate), +]); + +export const apmAnomalyParamsSchema = schema.object({ + serviceName: schema.maybe(schema.string()), + transactionType: schema.maybe(schema.string()), + windowSize: schema.number(), + windowUnit: schema.string(), + environment: schema.string(), + anomalySeverityType: schema.oneOf([ + schema.literal(ML_ANOMALY_SEVERITY.CRITICAL), + schema.literal(ML_ANOMALY_SEVERITY.MAJOR), + schema.literal(ML_ANOMALY_SEVERITY.MINOR), + schema.literal(ML_ANOMALY_SEVERITY.WARNING), + ]), + anomalyDetectorTypes: schema.maybe(schema.arrayOf(detectorsSchema, { minSize: 1 })), +}); + +export type ApmAnomalyRuleTypeParams = TypeOf; diff --git a/packages/response-ops/rule_params/common/search_configuration_schema.ts b/packages/response-ops/rule_params/common/search_configuration_schema.ts new file mode 100644 index 0000000000000..50b1f3ed1a561 --- /dev/null +++ b/packages/response-ops/rule_params/common/search_configuration_schema.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { TypeOf, schema } from '@kbn/config-schema'; + +export const searchConfigurationSchema = schema.object({ + query: schema.object({ + query: schema.oneOf([schema.string(), schema.recordOf(schema.string(), schema.any())]), + language: schema.string(), + }), +}); + +export type SearchConfigurationType = TypeOf; diff --git a/packages/response-ops/rule_params/error_count/index.ts b/packages/response-ops/rule_params/error_count/index.ts new file mode 100644 index 0000000000000..75bb137c24a00 --- /dev/null +++ b/packages/response-ops/rule_params/error_count/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export { errorCountParamsSchema } from './latest'; +export { errorCountParamsSchema as errorCountParamsSchemaV1 } from './v1'; + +export type { ErrorCountRuleTypeParams } from './latest'; +export type { ErrorCountRuleTypeParams as ErrorCountRuleTypeParamsV1 } from './v1'; diff --git a/packages/response-ops/rule_params/error_count/latest.ts b/packages/response-ops/rule_params/error_count/latest.ts new file mode 100644 index 0000000000000..f278309c22b03 --- /dev/null +++ b/packages/response-ops/rule_params/error_count/latest.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './v1'; diff --git a/packages/response-ops/rule_params/error_count/v1.ts b/packages/response-ops/rule_params/error_count/v1.ts new file mode 100644 index 0000000000000..2affb40327c8b --- /dev/null +++ b/packages/response-ops/rule_params/error_count/v1.ts @@ -0,0 +1,25 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { TypeOf, schema } from '@kbn/config-schema'; +import { searchConfigurationSchema } from '../common/search_configuration_schema'; + +export const errorCountParamsSchema = schema.object({ + windowSize: schema.number(), + windowUnit: schema.string(), + threshold: schema.number(), + serviceName: schema.maybe(schema.string()), + environment: schema.string(), + groupBy: schema.maybe(schema.arrayOf(schema.string())), + errorGroupingKey: schema.maybe(schema.string()), + useKqlFilter: schema.maybe(schema.boolean()), + searchConfiguration: schema.maybe(searchConfigurationSchema), +}); + +export type ErrorCountRuleTypeParams = TypeOf; diff --git a/packages/response-ops/rule_params/transaction_duration/index.ts b/packages/response-ops/rule_params/transaction_duration/index.ts new file mode 100644 index 0000000000000..b967fcafad105 --- /dev/null +++ b/packages/response-ops/rule_params/transaction_duration/index.ts @@ -0,0 +1,5 @@ +export { transactionDurationParamsSchema } from './latest'; +export { transactionDurationParamsSchema as transactionDurationParamsSchemaV1 } from './v1'; + +export type { TransactionDurationRuleTypeParams } from './latest'; +export type { TransactionDurationRuleTypeParams as TransactionDurationRuleTypeParamsV1 } from './v1'; diff --git a/packages/response-ops/rule_params/transaction_duration/latest.ts b/packages/response-ops/rule_params/transaction_duration/latest.ts new file mode 100644 index 0000000000000..f278309c22b03 --- /dev/null +++ b/packages/response-ops/rule_params/transaction_duration/latest.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './v1'; diff --git a/packages/response-ops/rule_params/transaction_duration/v1.ts b/packages/response-ops/rule_params/transaction_duration/v1.ts new file mode 100644 index 0000000000000..98f820fcb6e70 --- /dev/null +++ b/packages/response-ops/rule_params/transaction_duration/v1.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { TypeOf, schema } from '@kbn/config-schema'; +import { searchConfigurationSchema } from '../common/search_configuration_schema'; + +export enum AggregationType { + Avg = 'avg', + P95 = '95th', + P99 = '99th', +} + +export const transactionDurationParamsSchema = schema.object({ + serviceName: schema.maybe(schema.string()), + transactionType: schema.maybe(schema.string()), + transactionName: schema.maybe(schema.string()), + windowSize: schema.number(), + windowUnit: schema.string(), + threshold: schema.number(), + aggregationType: schema.oneOf([ + schema.literal(AggregationType.Avg), + schema.literal(AggregationType.P95), + schema.literal(AggregationType.P99), + ]), + environment: schema.string(), + groupBy: schema.maybe(schema.arrayOf(schema.string())), + useKqlFilter: schema.maybe(schema.boolean()), + searchConfiguration: schema.maybe(searchConfigurationSchema), +}); + +export type TransactionDurationRuleTypeParams = TypeOf; diff --git a/packages/response-ops/rule_params/transaction_error_rate/index.ts b/packages/response-ops/rule_params/transaction_error_rate/index.ts new file mode 100644 index 0000000000000..69bb0d62353ba --- /dev/null +++ b/packages/response-ops/rule_params/transaction_error_rate/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export { transactionErrorRateParamsSchema } from './latest'; +export { transactionErrorRateParamsSchema as transactionErrorRateParamsSchemaV1 } from './v1'; + +export type { TransactionErrorRateRuleTypeParams } from './latest'; +export type { TransactionErrorRateRuleTypeParams as TransactionErrorRateRuleTypeParamsV1 } from './v1'; diff --git a/packages/response-ops/rule_params/transaction_error_rate/latest.ts b/packages/response-ops/rule_params/transaction_error_rate/latest.ts new file mode 100644 index 0000000000000..f278309c22b03 --- /dev/null +++ b/packages/response-ops/rule_params/transaction_error_rate/latest.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './v1'; diff --git a/packages/response-ops/rule_params/transaction_error_rate/v1.ts b/packages/response-ops/rule_params/transaction_error_rate/v1.ts new file mode 100644 index 0000000000000..65afefc67f6e2 --- /dev/null +++ b/packages/response-ops/rule_params/transaction_error_rate/v1.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { TypeOf, schema } from '@kbn/config-schema'; +import { searchConfigurationSchema } from '../common/search_configuration_schema'; + +export const transactionErrorRateParamsSchema = schema.object({ + windowSize: schema.number(), + windowUnit: schema.string(), + threshold: schema.number(), + transactionType: schema.maybe(schema.string()), + transactionName: schema.maybe(schema.string()), + serviceName: schema.maybe(schema.string()), + environment: schema.string(), + groupBy: schema.maybe(schema.arrayOf(schema.string())), + useKqlFilter: schema.maybe(schema.boolean()), + searchConfiguration: schema.maybe(searchConfigurationSchema), +}); + +export type TransactionErrorRateRuleTypeParams = TypeOf; diff --git a/packages/response-ops/rule_params/tsconfig.json b/packages/response-ops/rule_params/tsconfig.json index 3df73f778fdc1..da96acb60c09a 100644 --- a/packages/response-ops/rule_params/tsconfig.json +++ b/packages/response-ops/rule_params/tsconfig.json @@ -2,18 +2,9 @@ "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", - "types": [ - "jest", - "node" - ] + "types": ["jest", "node"] }, - "include": [ - "**/*.ts", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/config-schema", - ] + "include": ["**/*.ts"], + "exclude": ["target/**/*"], + "kbn_references": ["@kbn/config-schema", "@kbn/ml-anomaly-utils"] } diff --git a/packages/response-ops/rule_params/v1.ts b/packages/response-ops/rule_params/v1.ts index a083f67f10c8c..f88eb25142764 100644 --- a/packages/response-ops/rule_params/v1.ts +++ b/packages/response-ops/rule_params/v1.ts @@ -8,10 +8,20 @@ */ import { TypeOf, schema } from '@kbn/config-schema'; +import { transactionDurationParamsSchema as transactionDurationParamsSchemaV1 } from './transaction_duration/v1'; +import { apmAnomalyParamsSchema as apmAnomalyParamsSchemaV1 } from './apm_anomaly/v1'; +import { errorCountParamsSchema as errorCountParamsSchemaV1 } from './error_count/v1'; +import { transactionErrorRateParamsSchema as transactionErrorRateParamsSchemaV1 } from './transaction_error_rate/v1'; -export const ruleParamsSchema = schema.recordOf(schema.string(), schema.maybe(schema.any()), { - meta: { description: 'The parameters for the rule.' }, -}); +export const ruleParamsSchema = schema.oneOf([ + transactionDurationParamsSchemaV1, + apmAnomalyParamsSchemaV1, + errorCountParamsSchemaV1, + transactionErrorRateParamsSchemaV1, + schema.recordOf(schema.string(), schema.maybe(schema.any()), { + meta: { description: 'The parameters for the rule.' }, + }), +]); export const ruleParamsSchemaWithDefaultValue = schema.recordOf( schema.string(), diff --git a/x-pack/plugins/observability_solution/apm/common/rules/schema.ts b/x-pack/plugins/observability_solution/apm/common/rules/schema.ts deleted file mode 100644 index 0e6b0c166a688..0000000000000 --- a/x-pack/plugins/observability_solution/apm/common/rules/schema.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema, TypeOf } from '@kbn/config-schema'; -import { ML_ANOMALY_SEVERITY } from '@kbn/ml-anomaly-utils/anomaly_severity'; -import { ApmRuleType } from '@kbn/rule-data-utils'; -import { AnomalyDetectorType } from '../anomaly_detection/apm_ml_detectors'; -import { AggregationType } from './apm_rule_types'; - -export const searchConfigurationSchema = schema.object({ - query: schema.object({ - query: schema.oneOf([schema.string(), schema.recordOf(schema.string(), schema.any())]), - language: schema.string(), - }), -}); - -export const errorCountParamsSchema = schema.object({ - windowSize: schema.number(), - windowUnit: schema.string(), - threshold: schema.number(), - serviceName: schema.maybe(schema.string()), - environment: schema.string(), - groupBy: schema.maybe(schema.arrayOf(schema.string())), - errorGroupingKey: schema.maybe(schema.string()), - useKqlFilter: schema.maybe(schema.boolean()), - searchConfiguration: schema.maybe(searchConfigurationSchema), -}); - -export const transactionDurationParamsSchema = schema.object({ - serviceName: schema.maybe(schema.string()), - transactionType: schema.maybe(schema.string()), - transactionName: schema.maybe(schema.string()), - windowSize: schema.number(), - windowUnit: schema.string(), - threshold: schema.number(), - aggregationType: schema.oneOf([ - schema.literal(AggregationType.Avg), - schema.literal(AggregationType.P95), - schema.literal(AggregationType.P99), - ]), - environment: schema.string(), - groupBy: schema.maybe(schema.arrayOf(schema.string())), - useKqlFilter: schema.maybe(schema.boolean()), - searchConfiguration: schema.maybe(searchConfigurationSchema), -}); - -const detectorsSchema = schema.oneOf([ - schema.literal(AnomalyDetectorType.txLatency), - schema.literal(AnomalyDetectorType.txThroughput), - schema.literal(AnomalyDetectorType.txFailureRate), -]); - -export const anomalyParamsSchema = schema.object({ - serviceName: schema.maybe(schema.string()), - transactionType: schema.maybe(schema.string()), - windowSize: schema.number(), - windowUnit: schema.string(), - environment: schema.string(), - anomalySeverityType: schema.oneOf([ - schema.literal(ML_ANOMALY_SEVERITY.CRITICAL), - schema.literal(ML_ANOMALY_SEVERITY.MAJOR), - schema.literal(ML_ANOMALY_SEVERITY.MINOR), - schema.literal(ML_ANOMALY_SEVERITY.WARNING), - ]), - anomalyDetectorTypes: schema.maybe(schema.arrayOf(detectorsSchema, { minSize: 1 })), -}); - -export const transactionErrorRateParamsSchema = schema.object({ - windowSize: schema.number(), - windowUnit: schema.string(), - threshold: schema.number(), - transactionType: schema.maybe(schema.string()), - transactionName: schema.maybe(schema.string()), - serviceName: schema.maybe(schema.string()), - environment: schema.string(), - groupBy: schema.maybe(schema.arrayOf(schema.string())), - useKqlFilter: schema.maybe(schema.boolean()), - searchConfiguration: schema.maybe(searchConfigurationSchema), -}); - -type ErrorCountParamsType = TypeOf; -type TransactionDurationParamsType = TypeOf; -type AnomalyParamsType = TypeOf; -type TransactionErrorRateParamsType = TypeOf; - -export type SearchConfigurationType = TypeOf; - -export interface ApmRuleParamsType { - [ApmRuleType.TransactionDuration]: TransactionDurationParamsType; - [ApmRuleType.ErrorCount]: ErrorCountParamsType; - [ApmRuleType.Anomaly]: AnomalyParamsType; - [ApmRuleType.TransactionErrorRate]: TransactionErrorRateParamsType; -} diff --git a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx index e657fbd11d12e..d3972e657991e 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx @@ -14,7 +14,7 @@ import { ForLastExpression, TIME_UNITS } from '@kbn/triggers-actions-ui-plugin/p import { EuiFormRow } from '@elastic/eui'; import { EuiSpacer } from '@elastic/eui'; import { EuiSwitchEvent } from '@elastic/eui'; -import { SearchConfigurationType } from '../../../../../common/rules/schema'; +import { SearchConfigurationType } from '@kbn/response-ops-rule-params/common/search_configuration_schema'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { asInteger } from '../../../../../common/utils/formatters'; import { FETCH_STATUS, isPending, useFetcher } from '../../../../hooks/use_fetcher'; diff --git a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx index f2f2ab0e50510..778644ec06ad5 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx @@ -15,7 +15,7 @@ import { ForLastExpression, TIME_UNITS } from '@kbn/triggers-actions-ui-plugin/p import { EuiFormRow } from '@elastic/eui'; import { EuiSpacer } from '@elastic/eui'; import { EuiSwitchEvent } from '@elastic/eui'; -import { SearchConfigurationType } from '../../../../../common/rules/schema'; +import { SearchConfigurationType } from '@kbn/response-ops-rule-params/common/search_configuration_schema'; import { AggregationType } from '../../../../../common/rules/apm_rule_types'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { getDurationFormatter } from '../../../../../common/utils/formatters'; diff --git a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx index 35a64ed9d8c2a..6cad1dce9d969 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx @@ -14,7 +14,7 @@ import { ForLastExpression, TIME_UNITS } from '@kbn/triggers-actions-ui-plugin/p import { EuiFormRow } from '@elastic/eui'; import { EuiSpacer } from '@elastic/eui'; import { EuiSwitchEvent } from '@elastic/eui'; -import { SearchConfigurationType } from '../../../../../common/rules/schema'; +import { SearchConfigurationType } from '@kbn/response-ops-rule-params/common/search_configuration_schema'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { asPercent } from '../../../../../common/utils/formatters'; import { FETCH_STATUS, isPending, useFetcher } from '../../../../hooks/use_fetcher'; diff --git a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts index 531b5c9558a56..5e5876317b296 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts @@ -35,6 +35,10 @@ import { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils'; import { addSpaceIdToPath } from '@kbn/spaces-plugin/common'; import { asyncForEach } from '@kbn/std'; import { compact } from 'lodash'; +import { + apmAnomalyParamsSchema, + ApmAnomalyRuleTypeParams, +} from '@kbn/response-ops-rule-params/apm_anomaly'; import { getSeverity } from '../../../../../common/anomaly_detection'; import { PROCESSOR_EVENT, @@ -62,7 +66,6 @@ import { RegisterRuleDependencies, } from '../../register_apm_rule_types'; import { getServiceGroupFieldsForAnomaly } from './get_service_group_fields_for_anomaly'; -import { anomalyParamsSchema, ApmRuleParamsType } from '../../../../../common/rules/schema'; import { getAnomalyDetectorIndex, getAnomalyDetectorType, @@ -70,7 +73,6 @@ import { const ruleTypeConfig = RULE_TYPES_CONFIG[ApmRuleType.Anomaly]; -type AnomalyRuleTypeParams = ApmRuleParamsType[ApmRuleType.Anomaly]; type AnomalyActionGroups = ActionGroupIdsOf; type AnomalyRuleTypeState = RuleTypeState; type AnomalyAlertState = AlertState; @@ -95,11 +97,11 @@ export function registerAnomalyRuleType({ name: ruleTypeConfig.name, actionGroups: ruleTypeConfig.actionGroups, defaultActionGroupId: ruleTypeConfig.defaultActionGroupId, - validate: { params: anomalyParamsSchema }, + validate: { params: apmAnomalyParamsSchema }, schemas: { params: { type: 'config-schema', - schema: anomalyParamsSchema, + schema: apmAnomalyParamsSchema, }, }, actionVariables: { @@ -120,7 +122,7 @@ export function registerAnomalyRuleType({ isExportable: true, executor: async ( options: RuleExecutorOptions< - AnomalyRuleTypeParams, + ApmAnomalyRuleTypeParams, AnomalyRuleTypeState, AnomalyAlertState, AnomalyAlertContext, diff --git a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts index 8fb4000645a2e..f4638f45c88e4 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts @@ -32,6 +32,10 @@ import { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils'; import { getParsedFilterQuery, termQuery } from '@kbn/observability-plugin/server'; import { addSpaceIdToPath } from '@kbn/spaces-plugin/common'; import { asyncForEach } from '@kbn/std'; +import { + errorCountParamsSchema, + ErrorCountRuleTypeParams, +} from '@kbn/response-ops-rule-params/error_count'; import { getEnvironmentEsField } from '../../../../../common/environment_filter_values'; import { ERROR_GROUP_ID, @@ -45,7 +49,6 @@ import { RULE_TYPES_CONFIG, THRESHOLD_MET_GROUP, } from '../../../../../common/rules/apm_rule_types'; -import { errorCountParamsSchema, ApmRuleParamsType } from '../../../../../common/rules/schema'; import { environmentQuery } from '../../../../../common/utils/environment_query'; import { getAlertUrlErrorCount } from '../../../../../common/utils/formatters'; import { apmActionVariables } from '../../action_variables'; @@ -78,7 +81,6 @@ export const errorCountActionVariables = [ apmActionVariables.viewInAppUrl, ]; -type ErrorCountRuleTypeParams = ApmRuleParamsType[ApmRuleType.ErrorCount]; type ErrorCountActionGroups = ActionGroupIdsOf; type ErrorCountRuleTypeState = RuleTypeState; type ErrorCountAlertState = AlertState; diff --git a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts index dfc32ec9eb54e..a64a068010de4 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts @@ -33,6 +33,10 @@ import { } from '@kbn/rule-data-utils'; import { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils'; import { addSpaceIdToPath } from '@kbn/spaces-plugin/common'; +import { + TransactionDurationRuleTypeParams, + transactionDurationParamsSchema, +} from '@kbn/response-ops-rule-params/transaction_duration'; import { getGroupByTerms } from '../utils/get_groupby_terms'; import { SearchAggregatedTransactionSetting } from '../../../../../common/aggregated_transactions'; import { getEnvironmentEsField } from '../../../../../common/environment_filter_values'; @@ -49,10 +53,6 @@ import { RULE_TYPES_CONFIG, THRESHOLD_MET_GROUP, } from '../../../../../common/rules/apm_rule_types'; -import { - transactionDurationParamsSchema, - ApmRuleParamsType, -} from '../../../../../common/rules/schema'; import { environmentQuery } from '../../../../../common/utils/environment_query'; import { getAlertUrlTransaction, @@ -91,7 +91,6 @@ export const transactionDurationActionVariables = [ apmActionVariables.viewInAppUrl, ]; -type TransactionDurationRuleTypeParams = ApmRuleParamsType[ApmRuleType.TransactionDuration]; type TransactionDurationActionGroups = ActionGroupIdsOf; type TransactionDurationRuleTypeState = RuleTypeState; type TransactionDurationAlertState = AlertState; diff --git a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts index 1090a1c91d54b..2417719cf97eb 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts @@ -33,6 +33,10 @@ import { import { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils'; import { addSpaceIdToPath } from '@kbn/spaces-plugin/common'; import { asyncForEach } from '@kbn/std'; +import { + TransactionErrorRateRuleTypeParams, + transactionErrorRateParamsSchema, +} from '@kbn/response-ops-rule-params/transaction_error_rate'; import { SearchAggregatedTransactionSetting } from '../../../../../common/aggregated_transactions'; import { getEnvironmentEsField } from '../../../../../common/environment_filter_values'; import { @@ -50,10 +54,6 @@ import { RULE_TYPES_CONFIG, THRESHOLD_MET_GROUP, } from '../../../../../common/rules/apm_rule_types'; -import { - transactionErrorRateParamsSchema, - ApmRuleParamsType, -} from '../../../../../common/rules/schema'; import { environmentQuery } from '../../../../../common/utils/environment_query'; import { asDecimalOrInteger, getAlertUrlTransaction } from '../../../../../common/utils/formatters'; import { getBackwardCompatibleDocumentTypeFilter } from '../../../../lib/helpers/transactions'; @@ -86,7 +86,6 @@ export const transactionErrorRateActionVariables = [ apmActionVariables.viewInAppUrl, ]; -type TransactionErrorRateRuleTypeParams = ApmRuleParamsType[ApmRuleType.TransactionErrorRate]; type TransactionErrorRateActionGroups = ActionGroupIdsOf; type TransactionErrorRateRuleTypeState = RuleTypeState; type TransactionErrorRateAlertState = AlertState; diff --git a/x-pack/test/api_integration/deployment_agnostic/services/alerting_api.ts b/x-pack/test/api_integration/deployment_agnostic/services/alerting_api.ts index 855d5bd3cdff8..a13a5f6e8716c 100644 --- a/x-pack/test/api_integration/deployment_agnostic/services/alerting_api.ts +++ b/x-pack/test/api_integration/deployment_agnostic/services/alerting_api.ts @@ -11,10 +11,13 @@ import type { } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { MetricThresholdParams } from '@kbn/infra-plugin/common/alerting/metrics'; import { ThresholdParams } from '@kbn/observability-plugin/common/custom_threshold_rule/types'; -import { ApmRuleParamsType } from '@kbn/apm-plugin/common/rules/schema'; import { RoleCredentials } from '@kbn/ftr-common-functional-services'; import { errors, type Client } from '@elastic/elasticsearch'; import type { TryWithRetriesOptions } from '@kbn/ftr-common-functional-services'; +import { ApmAnomalyRuleTypeParams } from '@kbn/response-ops-rule-params/apm_anomaly'; +import { ErrorCountRuleTypeParams } from '@kbn/response-ops-rule-params/error_count'; +import { TransactionDurationRuleTypeParams } from '@kbn/response-ops-rule-params/transaction_duration'; +import { TransactionErrorRateRuleTypeParams } from '@kbn/response-ops-rule-params/transaction_error_rate'; import { v4 as uuidv4 } from 'uuid'; import moment from 'moment'; import { DeploymentAgnosticFtrProviderContext } from '../ftr_provider_context'; @@ -1076,10 +1079,10 @@ export function AlertingApiProvider({ getService }: DeploymentAgnosticFtrProvide | MetricThresholdParams | ThresholdParams | SloBurnRateRuleParams - | ApmRuleParamsType['apm.anomaly'] - | ApmRuleParamsType['apm.error_rate'] - | ApmRuleParamsType['apm.transaction_duration'] - | ApmRuleParamsType['apm.transaction_error_rate']; + | ApmAnomalyRuleTypeParams + | ErrorCountRuleTypeParams + | TransactionDurationRuleTypeParams + | TransactionErrorRateRuleTypeParams; actions?: any[]; tags?: any[]; schedule?: { interval: string }; diff --git a/x-pack/test/apm_api_integration/tests/alerts/helpers/alerting_api_helper.ts b/x-pack/test/apm_api_integration/tests/alerts/helpers/alerting_api_helper.ts index 86544981bbdb4..8782e821195be 100644 --- a/x-pack/test/apm_api_integration/tests/alerts/helpers/alerting_api_helper.ts +++ b/x-pack/test/apm_api_integration/tests/alerts/helpers/alerting_api_helper.ts @@ -10,7 +10,11 @@ import { ParsedTechnicalFields } from '@kbn/rule-registry-plugin/common'; import pRetry from 'p-retry'; import type { Agent as SuperTestAgent } from 'supertest'; import { ApmRuleType } from '@kbn/rule-data-utils'; -import { ApmRuleParamsType } from '@kbn/apm-plugin/common/rules/schema'; +import { TransactionDurationRuleTypeParams } from '@kbn/response-ops-rule-params/transaction_duration'; +import { ErrorCountRuleTypeParams } from '@kbn/response-ops-rule-params/error_count'; +import { ApmAnomalyRuleTypeParams } from '@kbn/response-ops-rule-params/apm_anomaly'; +import { TransactionErrorRateRuleTypeParams } from '@kbn/response-ops-rule-params/transaction_error_rate'; + import { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils'; import { APM_ACTION_VARIABLE_INDEX, @@ -27,7 +31,11 @@ export async function createApmRule({ supertest: SuperTestAgent; ruleTypeId: T; name: string; - params: ApmRuleParamsType[T]; + params: + | TransactionDurationRuleTypeParams + | ErrorCountRuleTypeParams + | ApmAnomalyRuleTypeParams + | TransactionErrorRateRuleTypeParams; actions?: any[]; }) { try { From 84dbe9bccffbeaab8177d7f333014575e528e240 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:31:18 +0000 Subject: [PATCH 02/15] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- x-pack/plugins/observability_solution/apm/tsconfig.json | 1 + x-pack/test/tsconfig.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/apm/tsconfig.json b/x-pack/plugins/observability_solution/apm/tsconfig.json index b2fda13c3f76f..86572047689c4 100644 --- a/x-pack/plugins/observability_solution/apm/tsconfig.json +++ b/x-pack/plugins/observability_solution/apm/tsconfig.json @@ -129,6 +129,7 @@ "@kbn/alerting-comparators", "@kbn/saved-search-component", "@kbn/saved-search-plugin", + "@kbn/response-ops-rule-params", ], "exclude": ["target/**/*"] } diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index ce202abc9738a..3effda1dbee3e 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -190,6 +190,7 @@ "@kbn/sse-utils-server", "@kbn/gen-ai-functional-testing", "@kbn/integration-assistant-plugin", - "@kbn/core-elasticsearch-server" + "@kbn/core-elasticsearch-server", + "@kbn/response-ops-rule-params" ] } From 024689e3c7cff7675110d349fd9c9223e0a45ff5 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:34:36 +0000 Subject: [PATCH 03/15] [CI] Auto-commit changed files from 'node scripts/capture_oas_snapshot --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --include-path /api/dashboards --update' --- oas_docs/bundle.json | 1328 ++++++++++++++++++++++++++++--- oas_docs/bundle.serverless.json | 1328 ++++++++++++++++++++++++++++--- 2 files changed, 2460 insertions(+), 196 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 320730edc972e..6de0b254e5d50 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -1466,9 +1466,292 @@ "type": "string" }, "params": { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregationType": { + "enum": [ + "avg", + "95th", + "99th" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "aggregationType", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "anomalyDetectorTypes": { + "items": { + "enum": [ + "txLatency", + "txThroughput", + "txFailureRate" + ], + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "anomalySeverityType": { + "enum": [ + "critical", + "major", + "minor", + "warning" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "environment", + "anomalySeverityType" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "errorGroupingKey": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + } + ] }, "revision": { "description": "The rule revision number.", @@ -2640,55 +2923,338 @@ "type": "string" }, "params": { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" - }, - "revision": { - "description": "The rule revision number.", - "type": "number" - }, - "rule_type_id": { - "description": "The rule type identifier.", - "type": "string" - }, - "running": { - "description": "Indicates whether the rule is running.", - "nullable": true, - "type": "boolean" - }, - "schedule": { - "additionalProperties": false, - "properties": { - "interval": { - "description": "The interval is specified in seconds, minutes, hours, or days.", - "type": "string" - } - }, - "required": [ - "interval" - ], - "type": "object" - }, - "scheduled_task_id": { - "description": "Identifier of the scheduled task.", - "type": "string" - }, - "snooze_schedule": { - "items": { - "additionalProperties": false, - "properties": { - "duration": { - "description": "Duration of the rule snooze schedule.", - "type": "number" - }, - "id": { - "description": "Identifier of the rule snooze schedule.", - "type": "string" - }, - "rRule": { - "additionalProperties": false, - "properties": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregationType": { + "enum": [ + "avg", + "95th", + "99th" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "aggregationType", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "anomalyDetectorTypes": { + "items": { + "enum": [ + "txLatency", + "txThroughput", + "txFailureRate" + ], + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "anomalySeverityType": { + "enum": [ + "critical", + "major", + "minor", + "warning" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "environment", + "anomalySeverityType" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "errorGroupingKey": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + } + ] + }, + "revision": { + "description": "The rule revision number.", + "type": "number" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "running": { + "description": "Indicates whether the rule is running.", + "nullable": true, + "type": "boolean" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "scheduled_task_id": { + "description": "Identifier of the scheduled task.", + "type": "string" + }, + "snooze_schedule": { + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule snooze schedule.", + "type": "number" + }, + "id": { + "description": "Identifier of the rule snooze schedule.", + "type": "string" + }, + "rRule": { + "additionalProperties": false, + "properties": { "byhour": { "items": { "description": "Indicates hours of the day to recur.", @@ -3754,52 +4320,335 @@ } }, "required": [ - "history", - "calculated_metrics", - "last_run" + "history", + "calculated_metrics", + "last_run" + ], + "type": "object" + } + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregationType": { + "enum": [ + "avg", + "95th", + "99th" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "aggregationType", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "anomalyDetectorTypes": { + "items": { + "enum": [ + "txLatency", + "txThroughput", + "txFailureRate" + ], + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "anomalySeverityType": { + "enum": [ + "critical", + "major", + "minor", + "warning" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "environment", + "anomalySeverityType" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "errorGroupingKey": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" ], "type": "object" + }, + { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" } - }, - "required": [ - "run" - ], - "type": "object" - }, - "mute_all": { - "description": "Indicates whether all alerts are muted.", - "type": "boolean" - }, - "muted_alert_ids": { - "items": { - "description": "List of identifiers of muted alerts. ", - "type": "string" - }, - "type": "array" - }, - "name": { - "description": " The name of the rule.", - "type": "string" - }, - "next_run": { - "description": "Date and time of the next run of the rule.", - "nullable": true, - "type": "string" - }, - "notify_when": { - "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", - "enum": [ - "onActionGroupChange", - "onActiveAlert", - "onThrottleInterval" - ], - "nullable": true, - "type": "string" - }, - "params": { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" + ] }, "revision": { "description": "The rule revision number.", @@ -5151,9 +6000,292 @@ "type": "string" }, "params": { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregationType": { + "enum": [ + "avg", + "95th", + "99th" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "aggregationType", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "anomalyDetectorTypes": { + "items": { + "enum": [ + "txLatency", + "txThroughput", + "txFailureRate" + ], + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "anomalySeverityType": { + "enum": [ + "critical", + "major", + "minor", + "warning" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "environment", + "anomalySeverityType" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "errorGroupingKey": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + } + ] }, "revision": { "description": "The rule revision number.", diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index b188ae0999b0d..b4bd4c7d247a1 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -1466,9 +1466,292 @@ "type": "string" }, "params": { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregationType": { + "enum": [ + "avg", + "95th", + "99th" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "aggregationType", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "anomalyDetectorTypes": { + "items": { + "enum": [ + "txLatency", + "txThroughput", + "txFailureRate" + ], + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "anomalySeverityType": { + "enum": [ + "critical", + "major", + "minor", + "warning" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "environment", + "anomalySeverityType" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "errorGroupingKey": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + } + ] }, "revision": { "description": "The rule revision number.", @@ -2640,55 +2923,338 @@ "type": "string" }, "params": { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" - }, - "revision": { - "description": "The rule revision number.", - "type": "number" - }, - "rule_type_id": { - "description": "The rule type identifier.", - "type": "string" - }, - "running": { - "description": "Indicates whether the rule is running.", - "nullable": true, - "type": "boolean" - }, - "schedule": { - "additionalProperties": false, - "properties": { - "interval": { - "description": "The interval is specified in seconds, minutes, hours, or days.", - "type": "string" - } - }, - "required": [ - "interval" - ], - "type": "object" - }, - "scheduled_task_id": { - "description": "Identifier of the scheduled task.", - "type": "string" - }, - "snooze_schedule": { - "items": { - "additionalProperties": false, - "properties": { - "duration": { - "description": "Duration of the rule snooze schedule.", - "type": "number" - }, - "id": { - "description": "Identifier of the rule snooze schedule.", - "type": "string" - }, - "rRule": { - "additionalProperties": false, - "properties": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregationType": { + "enum": [ + "avg", + "95th", + "99th" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "aggregationType", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "anomalyDetectorTypes": { + "items": { + "enum": [ + "txLatency", + "txThroughput", + "txFailureRate" + ], + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "anomalySeverityType": { + "enum": [ + "critical", + "major", + "minor", + "warning" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "environment", + "anomalySeverityType" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "errorGroupingKey": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + } + ] + }, + "revision": { + "description": "The rule revision number.", + "type": "number" + }, + "rule_type_id": { + "description": "The rule type identifier.", + "type": "string" + }, + "running": { + "description": "Indicates whether the rule is running.", + "nullable": true, + "type": "boolean" + }, + "schedule": { + "additionalProperties": false, + "properties": { + "interval": { + "description": "The interval is specified in seconds, minutes, hours, or days.", + "type": "string" + } + }, + "required": [ + "interval" + ], + "type": "object" + }, + "scheduled_task_id": { + "description": "Identifier of the scheduled task.", + "type": "string" + }, + "snooze_schedule": { + "items": { + "additionalProperties": false, + "properties": { + "duration": { + "description": "Duration of the rule snooze schedule.", + "type": "number" + }, + "id": { + "description": "Identifier of the rule snooze schedule.", + "type": "string" + }, + "rRule": { + "additionalProperties": false, + "properties": { "byhour": { "items": { "description": "Indicates hours of the day to recur.", @@ -3754,52 +4320,335 @@ } }, "required": [ - "history", - "calculated_metrics", - "last_run" + "history", + "calculated_metrics", + "last_run" + ], + "type": "object" + } + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregationType": { + "enum": [ + "avg", + "95th", + "99th" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "aggregationType", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "anomalyDetectorTypes": { + "items": { + "enum": [ + "txLatency", + "txThroughput", + "txFailureRate" + ], + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "anomalySeverityType": { + "enum": [ + "critical", + "major", + "minor", + "warning" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "environment", + "anomalySeverityType" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "errorGroupingKey": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" ], "type": "object" + }, + { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" } - }, - "required": [ - "run" - ], - "type": "object" - }, - "mute_all": { - "description": "Indicates whether all alerts are muted.", - "type": "boolean" - }, - "muted_alert_ids": { - "items": { - "description": "List of identifiers of muted alerts. ", - "type": "string" - }, - "type": "array" - }, - "name": { - "description": " The name of the rule.", - "type": "string" - }, - "next_run": { - "description": "Date and time of the next run of the rule.", - "nullable": true, - "type": "string" - }, - "notify_when": { - "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", - "enum": [ - "onActionGroupChange", - "onActiveAlert", - "onThrottleInterval" - ], - "nullable": true, - "type": "string" - }, - "params": { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" + ] }, "revision": { "description": "The rule revision number.", @@ -5151,9 +6000,292 @@ "type": "string" }, "params": { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregationType": { + "enum": [ + "avg", + "95th", + "99th" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "aggregationType", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "anomalyDetectorTypes": { + "items": { + "enum": [ + "txLatency", + "txThroughput", + "txFailureRate" + ], + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "anomalySeverityType": { + "enum": [ + "critical", + "major", + "minor", + "warning" + ], + "type": "string" + }, + "environment": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "environment", + "anomalySeverityType" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "errorGroupingKey": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "environment": { + "type": "string" + }, + "groupBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "searchConfiguration": { + "additionalProperties": false, + "properties": { + "query": { + "additionalProperties": false, + "properties": { + "language": { + "type": "string" + }, + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": {}, + "type": "object" + } + ] + } + }, + "required": [ + "query", + "language" + ], + "type": "object" + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "serviceName": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "transactionName": { + "type": "string" + }, + "transactionType": { + "type": "string" + }, + "useKqlFilter": { + "type": "boolean" + }, + "windowSize": { + "type": "number" + }, + "windowUnit": { + "type": "string" + } + }, + "required": [ + "windowSize", + "windowUnit", + "threshold", + "environment" + ], + "type": "object" + }, + { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" + } + ] }, "revision": { "description": "The rule revision number.", From bcdccabe481296a00aa86874d8ce9f85fc1bd81e Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:41:42 +0000 Subject: [PATCH 04/15] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- .../rule_params/transaction_duration/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/response-ops/rule_params/transaction_duration/index.ts b/packages/response-ops/rule_params/transaction_duration/index.ts index b967fcafad105..1f319b38a60fa 100644 --- a/packages/response-ops/rule_params/transaction_duration/index.ts +++ b/packages/response-ops/rule_params/transaction_duration/index.ts @@ -1,3 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + export { transactionDurationParamsSchema } from './latest'; export { transactionDurationParamsSchema as transactionDurationParamsSchemaV1 } from './v1'; From 93ffacb7916c1ef622bc305b089f67d93e49165f Mon Sep 17 00:00:00 2001 From: Janki Salvi Date: Wed, 18 Dec 2024 11:38:21 +0000 Subject: [PATCH 05/15] set rule params package visibility to shared --- packages/response-ops/rule_params/common/index.ts | 10 ++++++++++ packages/response-ops/rule_params/kibana.jsonc | 8 +++----- .../rule_params/transaction_duration/index.ts | 9 +++++++++ .../rule/methods/bulk_edit/bulk_edit_rules.ts | 2 +- .../rule_types/error_count_rule_type/index.tsx | 2 +- .../transaction_duration_rule_type/index.tsx | 2 +- .../transaction_error_rate_rule_type/index.tsx | 2 +- .../plugins/observability_solution/apm/tsconfig.json | 1 + 8 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 packages/response-ops/rule_params/common/index.ts diff --git a/packages/response-ops/rule_params/common/index.ts b/packages/response-ops/rule_params/common/index.ts new file mode 100644 index 0000000000000..4eaa2806a1a10 --- /dev/null +++ b/packages/response-ops/rule_params/common/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './search_configuration_schema'; diff --git a/packages/response-ops/rule_params/kibana.jsonc b/packages/response-ops/rule_params/kibana.jsonc index 1315303258949..1bf690c87bfd9 100644 --- a/packages/response-ops/rule_params/kibana.jsonc +++ b/packages/response-ops/rule_params/kibana.jsonc @@ -1,9 +1,7 @@ { "type": "shared-common", "id": "@kbn/response-ops-rule-params", - "owner": [ - "@elastic/response-ops" - ], + "owner": ["@elastic/response-ops"], "group": "platform", - "visibility": "private" -} \ No newline at end of file + "visibility": "shared" +} diff --git a/packages/response-ops/rule_params/transaction_duration/index.ts b/packages/response-ops/rule_params/transaction_duration/index.ts index b967fcafad105..1f319b38a60fa 100644 --- a/packages/response-ops/rule_params/transaction_duration/index.ts +++ b/packages/response-ops/rule_params/transaction_duration/index.ts @@ -1,3 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + export { transactionDurationParamsSchema } from './latest'; export { transactionDurationParamsSchema as transactionDurationParamsSchemaV1 } from './v1'; diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts index f7d83545ec193..4ef8a2284c47b 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts @@ -513,7 +513,7 @@ async function updateRuleAttributesAndParamsInMemory( // Increment revision if params ended up being modified AND it wasn't already incremented as part of attribute update if ( - shouldIncrementRevision(ruleParams) && + shouldIncrementRevision(ruleParams as Params) && !isParamsUpdateSkipped && rule.attributes.revision === updatedRule.revision ) { diff --git a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx index d3972e657991e..eeb6977ec3ccd 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx @@ -11,10 +11,10 @@ import React, { useCallback, useEffect } from 'react'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { ForLastExpression, TIME_UNITS } from '@kbn/triggers-actions-ui-plugin/public'; +import { SearchConfigurationType } from '@kbn/response-ops-rule-params/common'; import { EuiFormRow } from '@elastic/eui'; import { EuiSpacer } from '@elastic/eui'; import { EuiSwitchEvent } from '@elastic/eui'; -import { SearchConfigurationType } from '@kbn/response-ops-rule-params/common/search_configuration_schema'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { asInteger } from '../../../../../common/utils/formatters'; import { FETCH_STATUS, isPending, useFetcher } from '../../../../hooks/use_fetcher'; diff --git a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx index 778644ec06ad5..343dd4df480b7 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx @@ -15,7 +15,7 @@ import { ForLastExpression, TIME_UNITS } from '@kbn/triggers-actions-ui-plugin/p import { EuiFormRow } from '@elastic/eui'; import { EuiSpacer } from '@elastic/eui'; import { EuiSwitchEvent } from '@elastic/eui'; -import { SearchConfigurationType } from '@kbn/response-ops-rule-params/common/search_configuration_schema'; +import { SearchConfigurationType } from '@kbn/response-ops-rule-params/common'; import { AggregationType } from '../../../../../common/rules/apm_rule_types'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { getDurationFormatter } from '../../../../../common/utils/formatters'; diff --git a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx index 6cad1dce9d969..c2202a6e49e61 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx @@ -14,7 +14,7 @@ import { ForLastExpression, TIME_UNITS } from '@kbn/triggers-actions-ui-plugin/p import { EuiFormRow } from '@elastic/eui'; import { EuiSpacer } from '@elastic/eui'; import { EuiSwitchEvent } from '@elastic/eui'; -import { SearchConfigurationType } from '@kbn/response-ops-rule-params/common/search_configuration_schema'; +import { SearchConfigurationType } from '@kbn/response-ops-rule-params/common'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { asPercent } from '../../../../../common/utils/formatters'; import { FETCH_STATUS, isPending, useFetcher } from '../../../../hooks/use_fetcher'; diff --git a/x-pack/plugins/observability_solution/apm/tsconfig.json b/x-pack/plugins/observability_solution/apm/tsconfig.json index b2fda13c3f76f..22d69895e933b 100644 --- a/x-pack/plugins/observability_solution/apm/tsconfig.json +++ b/x-pack/plugins/observability_solution/apm/tsconfig.json @@ -129,6 +129,7 @@ "@kbn/alerting-comparators", "@kbn/saved-search-component", "@kbn/saved-search-plugin", + "@kbn/response-ops-rule-params" ], "exclude": ["target/**/*"] } From d5c1b5c3a9289c95d86437c3b43f0db298cc0695 Mon Sep 17 00:00:00 2001 From: Janki Salvi Date: Wed, 18 Dec 2024 12:14:40 +0000 Subject: [PATCH 06/15] fix lint --- x-pack/plugins/observability_solution/apm/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/observability_solution/apm/tsconfig.json b/x-pack/plugins/observability_solution/apm/tsconfig.json index 2a04f14d416aa..06097fbe2a11f 100644 --- a/x-pack/plugins/observability_solution/apm/tsconfig.json +++ b/x-pack/plugins/observability_solution/apm/tsconfig.json @@ -129,8 +129,8 @@ "@kbn/alerting-comparators", "@kbn/saved-search-component", "@kbn/saved-search-plugin", - "@kbn/response-ops-rule-params" - "@kbn/entityManager-plugin", + "@kbn/response-ops-rule-params", + "@kbn/entityManager-plugin" ], "exclude": ["target/**/*"] } From da8f4516a9435797e2a4367f33c31a704c79b086 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:16:02 +0000 Subject: [PATCH 07/15] [CI] Auto-commit changed files from 'make api-docs' --- oas_docs/output/kibana.serverless.yaml | 760 ++++++++++++++++++++++++- oas_docs/output/kibana.yaml | 760 ++++++++++++++++++++++++- 2 files changed, 1496 insertions(+), 24 deletions(-) diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 2a942bc85c3bc..34d5ad01b8505 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -1211,9 +1211,193 @@ paths: nullable: true type: string params: - additionalProperties: {} - description: The parameters for the rule. - type: object + anyOf: + - additionalProperties: false + type: object + properties: + aggregationType: + enum: + - avg + - 95th + - 99th + type: string + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - aggregationType + - environment + - additionalProperties: false + type: object + properties: + anomalyDetectorTypes: + items: + enum: + - txLatency + - txThroughput + - txFailureRate + type: string + minItems: 1 + type: array + anomalySeverityType: + enum: + - critical + - major + - minor + - warning + type: string + environment: + type: string + serviceName: + type: string + transactionType: + type: string + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - environment + - anomalySeverityType + - additionalProperties: false + type: object + properties: + environment: + type: string + errorGroupingKey: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: false + type: object + properties: + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -2116,9 +2300,193 @@ paths: nullable: true type: string params: - additionalProperties: {} - description: The parameters for the rule. - type: object + anyOf: + - additionalProperties: false + type: object + properties: + aggregationType: + enum: + - avg + - 95th + - 99th + type: string + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - aggregationType + - environment + - additionalProperties: false + type: object + properties: + anomalyDetectorTypes: + items: + enum: + - txLatency + - txThroughput + - txFailureRate + type: string + minItems: 1 + type: array + anomalySeverityType: + enum: + - critical + - major + - minor + - warning + type: string + environment: + type: string + serviceName: + type: string + transactionType: + type: string + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - environment + - anomalySeverityType + - additionalProperties: false + type: object + properties: + environment: + type: string + errorGroupingKey: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: false + type: object + properties: + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -2996,9 +3364,193 @@ paths: nullable: true type: string params: - additionalProperties: {} - description: The parameters for the rule. - type: object + anyOf: + - additionalProperties: false + type: object + properties: + aggregationType: + enum: + - avg + - 95th + - 99th + type: string + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - aggregationType + - environment + - additionalProperties: false + type: object + properties: + anomalyDetectorTypes: + items: + enum: + - txLatency + - txThroughput + - txFailureRate + type: string + minItems: 1 + type: array + anomalySeverityType: + enum: + - critical + - major + - minor + - warning + type: string + environment: + type: string + serviceName: + type: string + transactionType: + type: string + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - environment + - anomalySeverityType + - additionalProperties: false + type: object + properties: + environment: + type: string + errorGroupingKey: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: false + type: object + properties: + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -3980,9 +4532,193 @@ paths: nullable: true type: string params: - additionalProperties: {} - description: The parameters for the rule. - type: object + anyOf: + - additionalProperties: false + type: object + properties: + aggregationType: + enum: + - avg + - 95th + - 99th + type: string + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - aggregationType + - environment + - additionalProperties: false + type: object + properties: + anomalyDetectorTypes: + items: + enum: + - txLatency + - txThroughput + - txFailureRate + type: string + minItems: 1 + type: array + anomalySeverityType: + enum: + - critical + - major + - minor + - warning + type: string + environment: + type: string + serviceName: + type: string + transactionType: + type: string + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - environment + - anomalySeverityType + - additionalProperties: false + type: object + properties: + environment: + type: string + errorGroupingKey: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: false + type: object + properties: + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index f12014443bb0b..cca4ff6045581 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -1564,9 +1564,193 @@ paths: nullable: true type: string params: - additionalProperties: {} - description: The parameters for the rule. - type: object + anyOf: + - additionalProperties: false + type: object + properties: + aggregationType: + enum: + - avg + - 95th + - 99th + type: string + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - aggregationType + - environment + - additionalProperties: false + type: object + properties: + anomalyDetectorTypes: + items: + enum: + - txLatency + - txThroughput + - txFailureRate + type: string + minItems: 1 + type: array + anomalySeverityType: + enum: + - critical + - major + - minor + - warning + type: string + environment: + type: string + serviceName: + type: string + transactionType: + type: string + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - environment + - anomalySeverityType + - additionalProperties: false + type: object + properties: + environment: + type: string + errorGroupingKey: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: false + type: object + properties: + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -2468,9 +2652,193 @@ paths: nullable: true type: string params: - additionalProperties: {} - description: The parameters for the rule. - type: object + anyOf: + - additionalProperties: false + type: object + properties: + aggregationType: + enum: + - avg + - 95th + - 99th + type: string + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - aggregationType + - environment + - additionalProperties: false + type: object + properties: + anomalyDetectorTypes: + items: + enum: + - txLatency + - txThroughput + - txFailureRate + type: string + minItems: 1 + type: array + anomalySeverityType: + enum: + - critical + - major + - minor + - warning + type: string + environment: + type: string + serviceName: + type: string + transactionType: + type: string + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - environment + - anomalySeverityType + - additionalProperties: false + type: object + properties: + environment: + type: string + errorGroupingKey: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: false + type: object + properties: + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -3347,9 +3715,193 @@ paths: nullable: true type: string params: - additionalProperties: {} - description: The parameters for the rule. - type: object + anyOf: + - additionalProperties: false + type: object + properties: + aggregationType: + enum: + - avg + - 95th + - 99th + type: string + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - aggregationType + - environment + - additionalProperties: false + type: object + properties: + anomalyDetectorTypes: + items: + enum: + - txLatency + - txThroughput + - txFailureRate + type: string + minItems: 1 + type: array + anomalySeverityType: + enum: + - critical + - major + - minor + - warning + type: string + environment: + type: string + serviceName: + type: string + transactionType: + type: string + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - environment + - anomalySeverityType + - additionalProperties: false + type: object + properties: + environment: + type: string + errorGroupingKey: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: false + type: object + properties: + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -4323,9 +4875,193 @@ paths: nullable: true type: string params: - additionalProperties: {} - description: The parameters for the rule. - type: object + anyOf: + - additionalProperties: false + type: object + properties: + aggregationType: + enum: + - avg + - 95th + - 99th + type: string + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - aggregationType + - environment + - additionalProperties: false + type: object + properties: + anomalyDetectorTypes: + items: + enum: + - txLatency + - txThroughput + - txFailureRate + type: string + minItems: 1 + type: array + anomalySeverityType: + enum: + - critical + - major + - minor + - warning + type: string + environment: + type: string + serviceName: + type: string + transactionType: + type: string + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - environment + - anomalySeverityType + - additionalProperties: false + type: object + properties: + environment: + type: string + errorGroupingKey: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: false + type: object + properties: + environment: + type: string + groupBy: + items: + type: string + type: array + searchConfiguration: + additionalProperties: false + type: object + properties: + query: + additionalProperties: false + type: object + properties: + language: + type: string + query: + anyOf: + - type: string + - additionalProperties: {} + type: object + required: + - query + - language + required: + - query + serviceName: + type: string + threshold: + type: number + transactionName: + type: string + transactionType: + type: string + useKqlFilter: + type: boolean + windowSize: + type: number + windowUnit: + type: string + required: + - windowSize + - windowUnit + - threshold + - environment + - additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number From 539132e6a0cf7cb6ee40bccadf2b8c26536a6394 Mon Sep 17 00:00:00 2001 From: Janki Salvi Date: Mon, 23 Dec 2024 10:23:02 +0000 Subject: [PATCH 08/15] update schema names --- .../response-ops/rule_params/apm_anomaly/index.ts | 8 ++++---- packages/response-ops/rule_params/apm_anomaly/v1.ts | 4 ++-- .../response-ops/rule_params/error_count/index.ts | 4 ++-- packages/response-ops/rule_params/error_count/v1.ts | 2 +- .../rule_params/transaction_duration/index.ts | 4 ++-- .../rule_params/transaction_duration/v1.ts | 2 +- .../rule_params/transaction_error_rate/index.ts | 4 ++-- .../rule_params/transaction_error_rate/v1.ts | 2 +- packages/response-ops/rule_params/v1.ts | 4 ++-- .../apm/common/rules/apm_rule_types.ts | 11 +++++++++++ .../anomaly/register_anomaly_rule_type.ts | 13 ++++++------- .../error_count/register_error_count_rule_type.ts | 7 +++---- .../register_transaction_duration_rule_type.ts | 7 +++---- .../register_transaction_error_rate_rule_type.ts | 7 +++---- .../deployment_agnostic/services/alerting_api.ts | 13 +++++-------- .../tests/alerts/helpers/alerting_api_helper.ts | 11 ++--------- 16 files changed, 50 insertions(+), 53 deletions(-) diff --git a/packages/response-ops/rule_params/apm_anomaly/index.ts b/packages/response-ops/rule_params/apm_anomaly/index.ts index d85095e183062..dc6ebfe4ef99e 100644 --- a/packages/response-ops/rule_params/apm_anomaly/index.ts +++ b/packages/response-ops/rule_params/apm_anomaly/index.ts @@ -7,8 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -export { apmAnomalyParamsSchema } from './latest'; -export { apmAnomalyParamsSchema as apmAnomalyParamsSchemaV1 } from './v1'; +export { anomalyParamsSchema } from './latest'; +export { anomalyParamsSchema as anomalyParamsSchemaV1 } from './v1'; -export type { ApmAnomalyRuleTypeParams } from './latest'; -export type { ApmAnomalyRuleTypeParams as ApmAnomalyRuleTypeParamsV1 } from './v1'; +export type { AnomalyRuleParams } from './latest'; +export type { AnomalyRuleParams as AnomalyRuleParamsV1 } from './v1'; diff --git a/packages/response-ops/rule_params/apm_anomaly/v1.ts b/packages/response-ops/rule_params/apm_anomaly/v1.ts index 4bba73efa27a4..9e550815602a8 100644 --- a/packages/response-ops/rule_params/apm_anomaly/v1.ts +++ b/packages/response-ops/rule_params/apm_anomaly/v1.ts @@ -22,7 +22,7 @@ const detectorsSchema = schema.oneOf([ schema.literal(AnomalyDetectorType.txFailureRate), ]); -export const apmAnomalyParamsSchema = schema.object({ +export const anomalyParamsSchema = schema.object({ serviceName: schema.maybe(schema.string()), transactionType: schema.maybe(schema.string()), windowSize: schema.number(), @@ -37,4 +37,4 @@ export const apmAnomalyParamsSchema = schema.object({ anomalyDetectorTypes: schema.maybe(schema.arrayOf(detectorsSchema, { minSize: 1 })), }); -export type ApmAnomalyRuleTypeParams = TypeOf; +export type AnomalyRuleParams = TypeOf; diff --git a/packages/response-ops/rule_params/error_count/index.ts b/packages/response-ops/rule_params/error_count/index.ts index 75bb137c24a00..e14153eb3083f 100644 --- a/packages/response-ops/rule_params/error_count/index.ts +++ b/packages/response-ops/rule_params/error_count/index.ts @@ -10,5 +10,5 @@ export { errorCountParamsSchema } from './latest'; export { errorCountParamsSchema as errorCountParamsSchemaV1 } from './v1'; -export type { ErrorCountRuleTypeParams } from './latest'; -export type { ErrorCountRuleTypeParams as ErrorCountRuleTypeParamsV1 } from './v1'; +export type { ErrorCountRuleParams } from './latest'; +export type { ErrorCountRuleParams as ErrorCountRuleParamsV1 } from './v1'; diff --git a/packages/response-ops/rule_params/error_count/v1.ts b/packages/response-ops/rule_params/error_count/v1.ts index 2affb40327c8b..cbbd6742bf235 100644 --- a/packages/response-ops/rule_params/error_count/v1.ts +++ b/packages/response-ops/rule_params/error_count/v1.ts @@ -22,4 +22,4 @@ export const errorCountParamsSchema = schema.object({ searchConfiguration: schema.maybe(searchConfigurationSchema), }); -export type ErrorCountRuleTypeParams = TypeOf; +export type ErrorCountRuleParams = TypeOf; diff --git a/packages/response-ops/rule_params/transaction_duration/index.ts b/packages/response-ops/rule_params/transaction_duration/index.ts index 1f319b38a60fa..baf910d1c033c 100644 --- a/packages/response-ops/rule_params/transaction_duration/index.ts +++ b/packages/response-ops/rule_params/transaction_duration/index.ts @@ -10,5 +10,5 @@ export { transactionDurationParamsSchema } from './latest'; export { transactionDurationParamsSchema as transactionDurationParamsSchemaV1 } from './v1'; -export type { TransactionDurationRuleTypeParams } from './latest'; -export type { TransactionDurationRuleTypeParams as TransactionDurationRuleTypeParamsV1 } from './v1'; +export type { TransactionDurationRuleParams } from './latest'; +export type { TransactionDurationRuleParams as TransactionDurationRuleParamsV1 } from './v1'; diff --git a/packages/response-ops/rule_params/transaction_duration/v1.ts b/packages/response-ops/rule_params/transaction_duration/v1.ts index 98f820fcb6e70..ab80398666607 100644 --- a/packages/response-ops/rule_params/transaction_duration/v1.ts +++ b/packages/response-ops/rule_params/transaction_duration/v1.ts @@ -34,4 +34,4 @@ export const transactionDurationParamsSchema = schema.object({ searchConfiguration: schema.maybe(searchConfigurationSchema), }); -export type TransactionDurationRuleTypeParams = TypeOf; +export type TransactionDurationRuleParams = TypeOf; diff --git a/packages/response-ops/rule_params/transaction_error_rate/index.ts b/packages/response-ops/rule_params/transaction_error_rate/index.ts index 69bb0d62353ba..c9630b7347e81 100644 --- a/packages/response-ops/rule_params/transaction_error_rate/index.ts +++ b/packages/response-ops/rule_params/transaction_error_rate/index.ts @@ -10,5 +10,5 @@ export { transactionErrorRateParamsSchema } from './latest'; export { transactionErrorRateParamsSchema as transactionErrorRateParamsSchemaV1 } from './v1'; -export type { TransactionErrorRateRuleTypeParams } from './latest'; -export type { TransactionErrorRateRuleTypeParams as TransactionErrorRateRuleTypeParamsV1 } from './v1'; +export type { TransactionErrorRateRuleParams } from './latest'; +export type { TransactionErrorRateRuleParams as TransactionErrorRateRuleParamsV1 } from './v1'; diff --git a/packages/response-ops/rule_params/transaction_error_rate/v1.ts b/packages/response-ops/rule_params/transaction_error_rate/v1.ts index 65afefc67f6e2..452279d8ddd19 100644 --- a/packages/response-ops/rule_params/transaction_error_rate/v1.ts +++ b/packages/response-ops/rule_params/transaction_error_rate/v1.ts @@ -23,4 +23,4 @@ export const transactionErrorRateParamsSchema = schema.object({ searchConfiguration: schema.maybe(searchConfigurationSchema), }); -export type TransactionErrorRateRuleTypeParams = TypeOf; +export type TransactionErrorRateRuleParams = TypeOf; diff --git a/packages/response-ops/rule_params/v1.ts b/packages/response-ops/rule_params/v1.ts index f88eb25142764..75edf741da38b 100644 --- a/packages/response-ops/rule_params/v1.ts +++ b/packages/response-ops/rule_params/v1.ts @@ -9,13 +9,13 @@ import { TypeOf, schema } from '@kbn/config-schema'; import { transactionDurationParamsSchema as transactionDurationParamsSchemaV1 } from './transaction_duration/v1'; -import { apmAnomalyParamsSchema as apmAnomalyParamsSchemaV1 } from './apm_anomaly/v1'; +import { anomalyParamsSchema as anomalyParamsSchemaV1 } from './apm_anomaly/v1'; import { errorCountParamsSchema as errorCountParamsSchemaV1 } from './error_count/v1'; import { transactionErrorRateParamsSchema as transactionErrorRateParamsSchemaV1 } from './transaction_error_rate/v1'; export const ruleParamsSchema = schema.oneOf([ transactionDurationParamsSchemaV1, - apmAnomalyParamsSchemaV1, + anomalyParamsSchemaV1, errorCountParamsSchemaV1, transactionErrorRateParamsSchemaV1, schema.recordOf(schema.string(), schema.maybe(schema.any()), { diff --git a/x-pack/plugins/observability_solution/apm/common/rules/apm_rule_types.ts b/x-pack/plugins/observability_solution/apm/common/rules/apm_rule_types.ts index fe93b024bb2b8..fe6c21747ff0c 100644 --- a/x-pack/plugins/observability_solution/apm/common/rules/apm_rule_types.ts +++ b/x-pack/plugins/observability_solution/apm/common/rules/apm_rule_types.ts @@ -13,6 +13,10 @@ import { formatDurationFromTimeUnitChar } from '@kbn/observability-plugin/common import { ML_ANOMALY_SEVERITY } from '@kbn/ml-anomaly-utils/anomaly_severity'; import { ML_ANOMALY_THRESHOLD } from '@kbn/ml-anomaly-utils/anomaly_threshold'; import { ApmRuleType } from '@kbn/rule-data-utils'; +import { ErrorCountRuleParams } from '@kbn/response-ops-rule-params/error_count'; +import { TransactionDurationRuleParams } from '@kbn/response-ops-rule-params/transaction_duration'; +import { AnomalyRuleParams } from '@kbn/response-ops-rule-params/apm_anomaly'; +import { TransactionErrorRateRuleParams } from '@kbn/response-ops-rule-params/transaction_error_rate'; import { ERROR_GROUP_ID, ERROR_GROUP_NAME, @@ -32,6 +36,13 @@ export enum AggregationType { P99 = '99th', } +export interface ApmRuleParamsType { + [ApmRuleType.TransactionDuration]: TransactionDurationRuleParams; + [ApmRuleType.ErrorCount]: ErrorCountRuleParams; + [ApmRuleType.Anomaly]: AnomalyRuleParams; + [ApmRuleType.TransactionErrorRate]: TransactionErrorRateRuleParams; +} + export const THRESHOLD_MET_GROUP_ID = 'threshold_met'; export type ThresholdMetActionGroupId = typeof THRESHOLD_MET_GROUP_ID; export const THRESHOLD_MET_GROUP: ActionGroup = { diff --git a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts index 5e5876317b296..f0b6b16ca397f 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts @@ -35,10 +35,7 @@ import { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils'; import { addSpaceIdToPath } from '@kbn/spaces-plugin/common'; import { asyncForEach } from '@kbn/std'; import { compact } from 'lodash'; -import { - apmAnomalyParamsSchema, - ApmAnomalyRuleTypeParams, -} from '@kbn/response-ops-rule-params/apm_anomaly'; +import { anomalyParamsSchema } from '@kbn/response-ops-rule-params/apm_anomaly'; import { getSeverity } from '../../../../../common/anomaly_detection'; import { PROCESSOR_EVENT, @@ -53,6 +50,7 @@ import { import { ANOMALY_ALERT_SEVERITY_TYPES, APM_SERVER_FEATURE_ID, + ApmRuleParamsType, formatAnomalyReason, RULE_TYPES_CONFIG, THRESHOLD_MET_GROUP, @@ -73,6 +71,7 @@ import { const ruleTypeConfig = RULE_TYPES_CONFIG[ApmRuleType.Anomaly]; +type AnomalyRuleTypeParams = ApmRuleParamsType[ApmRuleType.Anomaly]; type AnomalyActionGroups = ActionGroupIdsOf; type AnomalyRuleTypeState = RuleTypeState; type AnomalyAlertState = AlertState; @@ -97,11 +96,11 @@ export function registerAnomalyRuleType({ name: ruleTypeConfig.name, actionGroups: ruleTypeConfig.actionGroups, defaultActionGroupId: ruleTypeConfig.defaultActionGroupId, - validate: { params: apmAnomalyParamsSchema }, + validate: { params: anomalyParamsSchema }, schemas: { params: { type: 'config-schema', - schema: apmAnomalyParamsSchema, + schema: anomalyParamsSchema, }, }, actionVariables: { @@ -122,7 +121,7 @@ export function registerAnomalyRuleType({ isExportable: true, executor: async ( options: RuleExecutorOptions< - ApmAnomalyRuleTypeParams, + AnomalyRuleTypeParams, AnomalyRuleTypeState, AnomalyAlertState, AnomalyAlertContext, diff --git a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts index f4638f45c88e4..0ac2411f1cc65 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/error_count/register_error_count_rule_type.ts @@ -32,10 +32,7 @@ import { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils'; import { getParsedFilterQuery, termQuery } from '@kbn/observability-plugin/server'; import { addSpaceIdToPath } from '@kbn/spaces-plugin/common'; import { asyncForEach } from '@kbn/std'; -import { - errorCountParamsSchema, - ErrorCountRuleTypeParams, -} from '@kbn/response-ops-rule-params/error_count'; +import { errorCountParamsSchema } from '@kbn/response-ops-rule-params/error_count'; import { getEnvironmentEsField } from '../../../../../common/environment_filter_values'; import { ERROR_GROUP_ID, @@ -45,6 +42,7 @@ import { } from '../../../../../common/es_fields/apm'; import { APM_SERVER_FEATURE_ID, + ApmRuleParamsType, formatErrorCountReason, RULE_TYPES_CONFIG, THRESHOLD_MET_GROUP, @@ -81,6 +79,7 @@ export const errorCountActionVariables = [ apmActionVariables.viewInAppUrl, ]; +type ErrorCountRuleTypeParams = ApmRuleParamsType[ApmRuleType.ErrorCount]; type ErrorCountActionGroups = ActionGroupIdsOf; type ErrorCountRuleTypeState = RuleTypeState; type ErrorCountAlertState = AlertState; diff --git a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts index a64a068010de4..cc72609a2a7ce 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts @@ -33,10 +33,7 @@ import { } from '@kbn/rule-data-utils'; import { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils'; import { addSpaceIdToPath } from '@kbn/spaces-plugin/common'; -import { - TransactionDurationRuleTypeParams, - transactionDurationParamsSchema, -} from '@kbn/response-ops-rule-params/transaction_duration'; +import { transactionDurationParamsSchema } from '@kbn/response-ops-rule-params/transaction_duration'; import { getGroupByTerms } from '../utils/get_groupby_terms'; import { SearchAggregatedTransactionSetting } from '../../../../../common/aggregated_transactions'; import { getEnvironmentEsField } from '../../../../../common/environment_filter_values'; @@ -49,6 +46,7 @@ import { } from '../../../../../common/es_fields/apm'; import { APM_SERVER_FEATURE_ID, + ApmRuleParamsType, formatTransactionDurationReason, RULE_TYPES_CONFIG, THRESHOLD_MET_GROUP, @@ -91,6 +89,7 @@ export const transactionDurationActionVariables = [ apmActionVariables.viewInAppUrl, ]; +type TransactionDurationRuleTypeParams = ApmRuleParamsType[ApmRuleType.TransactionDuration]; type TransactionDurationActionGroups = ActionGroupIdsOf; type TransactionDurationRuleTypeState = RuleTypeState; type TransactionDurationAlertState = AlertState; diff --git a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts index 2417719cf97eb..e00d6af28e154 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts @@ -33,10 +33,7 @@ import { import { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils'; import { addSpaceIdToPath } from '@kbn/spaces-plugin/common'; import { asyncForEach } from '@kbn/std'; -import { - TransactionErrorRateRuleTypeParams, - transactionErrorRateParamsSchema, -} from '@kbn/response-ops-rule-params/transaction_error_rate'; +import { transactionErrorRateParamsSchema } from '@kbn/response-ops-rule-params/transaction_error_rate'; import { SearchAggregatedTransactionSetting } from '../../../../../common/aggregated_transactions'; import { getEnvironmentEsField } from '../../../../../common/environment_filter_values'; import { @@ -50,6 +47,7 @@ import { import { EventOutcome } from '../../../../../common/event_outcome'; import { APM_SERVER_FEATURE_ID, + ApmRuleParamsType, formatTransactionErrorRateReason, RULE_TYPES_CONFIG, THRESHOLD_MET_GROUP, @@ -86,6 +84,7 @@ export const transactionErrorRateActionVariables = [ apmActionVariables.viewInAppUrl, ]; +type TransactionErrorRateRuleTypeParams = ApmRuleParamsType[ApmRuleType.TransactionErrorRate]; type TransactionErrorRateActionGroups = ActionGroupIdsOf; type TransactionErrorRateRuleTypeState = RuleTypeState; type TransactionErrorRateAlertState = AlertState; diff --git a/x-pack/test/api_integration/deployment_agnostic/services/alerting_api.ts b/x-pack/test/api_integration/deployment_agnostic/services/alerting_api.ts index a13a5f6e8716c..d453a084ed4dc 100644 --- a/x-pack/test/api_integration/deployment_agnostic/services/alerting_api.ts +++ b/x-pack/test/api_integration/deployment_agnostic/services/alerting_api.ts @@ -14,10 +14,7 @@ import { ThresholdParams } from '@kbn/observability-plugin/common/custom_thresho import { RoleCredentials } from '@kbn/ftr-common-functional-services'; import { errors, type Client } from '@elastic/elasticsearch'; import type { TryWithRetriesOptions } from '@kbn/ftr-common-functional-services'; -import { ApmAnomalyRuleTypeParams } from '@kbn/response-ops-rule-params/apm_anomaly'; -import { ErrorCountRuleTypeParams } from '@kbn/response-ops-rule-params/error_count'; -import { TransactionDurationRuleTypeParams } from '@kbn/response-ops-rule-params/transaction_duration'; -import { TransactionErrorRateRuleTypeParams } from '@kbn/response-ops-rule-params/transaction_error_rate'; +import { ApmRuleParamsType } from '@kbn/apm-plugin/common/rules/apm_rule_types'; import { v4 as uuidv4 } from 'uuid'; import moment from 'moment'; import { DeploymentAgnosticFtrProviderContext } from '../ftr_provider_context'; @@ -1079,10 +1076,10 @@ export function AlertingApiProvider({ getService }: DeploymentAgnosticFtrProvide | MetricThresholdParams | ThresholdParams | SloBurnRateRuleParams - | ApmAnomalyRuleTypeParams - | ErrorCountRuleTypeParams - | TransactionDurationRuleTypeParams - | TransactionErrorRateRuleTypeParams; + | ApmRuleParamsType['apm.anomaly'] + | ApmRuleParamsType['apm.error_rate'] + | ApmRuleParamsType['apm.transaction_duration'] + | ApmRuleParamsType['apm.transaction_error_rate']; actions?: any[]; tags?: any[]; schedule?: { interval: string }; diff --git a/x-pack/test/apm_api_integration/tests/alerts/helpers/alerting_api_helper.ts b/x-pack/test/apm_api_integration/tests/alerts/helpers/alerting_api_helper.ts index 8782e821195be..69d3664e38679 100644 --- a/x-pack/test/apm_api_integration/tests/alerts/helpers/alerting_api_helper.ts +++ b/x-pack/test/apm_api_integration/tests/alerts/helpers/alerting_api_helper.ts @@ -7,13 +7,10 @@ import { Client, errors } from '@elastic/elasticsearch'; import { ParsedTechnicalFields } from '@kbn/rule-registry-plugin/common'; +import { ApmRuleParamsType } from '@kbn/apm-plugin/common/rules/apm_rule_types'; import pRetry from 'p-retry'; import type { Agent as SuperTestAgent } from 'supertest'; import { ApmRuleType } from '@kbn/rule-data-utils'; -import { TransactionDurationRuleTypeParams } from '@kbn/response-ops-rule-params/transaction_duration'; -import { ErrorCountRuleTypeParams } from '@kbn/response-ops-rule-params/error_count'; -import { ApmAnomalyRuleTypeParams } from '@kbn/response-ops-rule-params/apm_anomaly'; -import { TransactionErrorRateRuleTypeParams } from '@kbn/response-ops-rule-params/transaction_error_rate'; import { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils'; import { @@ -31,11 +28,7 @@ export async function createApmRule({ supertest: SuperTestAgent; ruleTypeId: T; name: string; - params: - | TransactionDurationRuleTypeParams - | ErrorCountRuleTypeParams - | ApmAnomalyRuleTypeParams - | TransactionErrorRateRuleTypeParams; + params: ApmRuleParamsType[T]; actions?: any[]; }) { try { From 2cf7b29e0992b99090b9231bca44a962e9999ff9 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:44:14 +0000 Subject: [PATCH 09/15] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- x-pack/test/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 8511c8bdc3a7b..78b850a56548b 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -190,6 +190,5 @@ "@kbn/gen-ai-functional-testing", "@kbn/integration-assistant-plugin", "@kbn/core-elasticsearch-server", - "@kbn/response-ops-rule-params" ] } From cd5cddc55d5f3f00cf66996603eb596129416abd Mon Sep 17 00:00:00 2001 From: Janki Salvi Date: Mon, 23 Dec 2024 13:20:51 +0000 Subject: [PATCH 10/15] revert ruleParamsSchema update --- packages/response-ops/rule_params/v1.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/response-ops/rule_params/v1.ts b/packages/response-ops/rule_params/v1.ts index 75edf741da38b..a083f67f10c8c 100644 --- a/packages/response-ops/rule_params/v1.ts +++ b/packages/response-ops/rule_params/v1.ts @@ -8,20 +8,10 @@ */ import { TypeOf, schema } from '@kbn/config-schema'; -import { transactionDurationParamsSchema as transactionDurationParamsSchemaV1 } from './transaction_duration/v1'; -import { anomalyParamsSchema as anomalyParamsSchemaV1 } from './apm_anomaly/v1'; -import { errorCountParamsSchema as errorCountParamsSchemaV1 } from './error_count/v1'; -import { transactionErrorRateParamsSchema as transactionErrorRateParamsSchemaV1 } from './transaction_error_rate/v1'; -export const ruleParamsSchema = schema.oneOf([ - transactionDurationParamsSchemaV1, - anomalyParamsSchemaV1, - errorCountParamsSchemaV1, - transactionErrorRateParamsSchemaV1, - schema.recordOf(schema.string(), schema.maybe(schema.any()), { - meta: { description: 'The parameters for the rule.' }, - }), -]); +export const ruleParamsSchema = schema.recordOf(schema.string(), schema.maybe(schema.any()), { + meta: { description: 'The parameters for the rule.' }, +}); export const ruleParamsSchemaWithDefaultValue = schema.recordOf( schema.string(), From b6da21c71e07e8ae930bf5c7fc244817da2c4271 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 23 Dec 2024 13:36:26 +0000 Subject: [PATCH 11/15] [CI] Auto-commit changed files from 'node scripts/capture_oas_snapshot --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --include-path /api/dashboards --update' --- oas_docs/bundle.json | 1238 ++----------------------------- oas_docs/bundle.serverless.json | 1238 ++----------------------------- 2 files changed, 106 insertions(+), 2370 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index d4f318b8a7b40..3e3d47df01661 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -1466,292 +1466,9 @@ "type": "string" }, "params": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "aggregationType": { - "enum": [ - "avg", - "95th", - "99th" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "aggregationType", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "anomalyDetectorTypes": { - "items": { - "enum": [ - "txLatency", - "txThroughput", - "txFailureRate" - ], - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "anomalySeverityType": { - "enum": [ - "critical", - "major", - "minor", - "warning" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "serviceName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "environment", - "anomalySeverityType" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "errorGroupingKey": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" - } - ] + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" }, "revision": { "description": "The rule revision number.", @@ -2923,292 +2640,9 @@ "type": "string" }, "params": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "aggregationType": { - "enum": [ - "avg", - "95th", - "99th" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "aggregationType", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "anomalyDetectorTypes": { - "items": { - "enum": [ - "txLatency", - "txThroughput", - "txFailureRate" - ], - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "anomalySeverityType": { - "enum": [ - "critical", - "major", - "minor", - "warning" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "serviceName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "environment", - "anomalySeverityType" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "errorGroupingKey": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" - } - ] + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" }, "revision": { "description": "The rule revision number.", @@ -4316,339 +3750,56 @@ "timestamp", "metrics" ], - "type": "object" - } - }, - "required": [ - "history", - "calculated_metrics", - "last_run" - ], - "type": "object" - } - }, - "required": [ - "run" - ], - "type": "object" - }, - "mute_all": { - "description": "Indicates whether all alerts are muted.", - "type": "boolean" - }, - "muted_alert_ids": { - "items": { - "description": "List of identifiers of muted alerts. ", - "type": "string" - }, - "type": "array" - }, - "name": { - "description": " The name of the rule.", - "type": "string" - }, - "next_run": { - "description": "Date and time of the next run of the rule.", - "nullable": true, - "type": "string" - }, - "notify_when": { - "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", - "enum": [ - "onActionGroupChange", - "onActiveAlert", - "onThrottleInterval" - ], - "nullable": true, - "type": "string" - }, - "params": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "aggregationType": { - "enum": [ - "avg", - "95th", - "99th" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "aggregationType", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "anomalyDetectorTypes": { - "items": { - "enum": [ - "txLatency", - "txThroughput", - "txFailureRate" - ], - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "anomalySeverityType": { - "enum": [ - "critical", - "major", - "minor", - "warning" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "serviceName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "environment", - "anomalySeverityType" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "errorGroupingKey": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" + "type": "object" } }, "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" + "history", + "calculated_metrics", + "last_run" ], "type": "object" - }, - { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" } - ] + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" }, "revision": { "description": "The rule revision number.", @@ -6000,292 +5151,9 @@ "type": "string" }, "params": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "aggregationType": { - "enum": [ - "avg", - "95th", - "99th" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "aggregationType", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "anomalyDetectorTypes": { - "items": { - "enum": [ - "txLatency", - "txThroughput", - "txFailureRate" - ], - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "anomalySeverityType": { - "enum": [ - "critical", - "major", - "minor", - "warning" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "serviceName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "environment", - "anomalySeverityType" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "errorGroupingKey": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" - } - ] + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" }, "revision": { "description": "The rule revision number.", diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index b4bd4c7d247a1..b188ae0999b0d 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -1466,292 +1466,9 @@ "type": "string" }, "params": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "aggregationType": { - "enum": [ - "avg", - "95th", - "99th" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "aggregationType", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "anomalyDetectorTypes": { - "items": { - "enum": [ - "txLatency", - "txThroughput", - "txFailureRate" - ], - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "anomalySeverityType": { - "enum": [ - "critical", - "major", - "minor", - "warning" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "serviceName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "environment", - "anomalySeverityType" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "errorGroupingKey": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" - } - ] + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" }, "revision": { "description": "The rule revision number.", @@ -2923,292 +2640,9 @@ "type": "string" }, "params": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "aggregationType": { - "enum": [ - "avg", - "95th", - "99th" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "aggregationType", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "anomalyDetectorTypes": { - "items": { - "enum": [ - "txLatency", - "txThroughput", - "txFailureRate" - ], - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "anomalySeverityType": { - "enum": [ - "critical", - "major", - "minor", - "warning" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "serviceName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "environment", - "anomalySeverityType" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "errorGroupingKey": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" - } - ] + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" }, "revision": { "description": "The rule revision number.", @@ -4316,339 +3750,56 @@ "timestamp", "metrics" ], - "type": "object" - } - }, - "required": [ - "history", - "calculated_metrics", - "last_run" - ], - "type": "object" - } - }, - "required": [ - "run" - ], - "type": "object" - }, - "mute_all": { - "description": "Indicates whether all alerts are muted.", - "type": "boolean" - }, - "muted_alert_ids": { - "items": { - "description": "List of identifiers of muted alerts. ", - "type": "string" - }, - "type": "array" - }, - "name": { - "description": " The name of the rule.", - "type": "string" - }, - "next_run": { - "description": "Date and time of the next run of the rule.", - "nullable": true, - "type": "string" - }, - "notify_when": { - "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", - "enum": [ - "onActionGroupChange", - "onActiveAlert", - "onThrottleInterval" - ], - "nullable": true, - "type": "string" - }, - "params": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "aggregationType": { - "enum": [ - "avg", - "95th", - "99th" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "aggregationType", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "anomalyDetectorTypes": { - "items": { - "enum": [ - "txLatency", - "txThroughput", - "txFailureRate" - ], - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "anomalySeverityType": { - "enum": [ - "critical", - "major", - "minor", - "warning" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "serviceName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "environment", - "anomalySeverityType" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "errorGroupingKey": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" + "type": "object" } }, "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" + "history", + "calculated_metrics", + "last_run" ], "type": "object" - }, - { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" } - ] + }, + "required": [ + "run" + ], + "type": "object" + }, + "mute_all": { + "description": "Indicates whether all alerts are muted.", + "type": "boolean" + }, + "muted_alert_ids": { + "items": { + "description": "List of identifiers of muted alerts. ", + "type": "string" + }, + "type": "array" + }, + "name": { + "description": " The name of the rule.", + "type": "string" + }, + "next_run": { + "description": "Date and time of the next run of the rule.", + "nullable": true, + "type": "string" + }, + "notify_when": { + "description": "Indicates how often alerts generate actions. Valid values include: `onActionGroupChange`: Actions run when the alert status changes; `onActiveAlert`: Actions run when the alert becomes active and at each check interval while the rule conditions are met; `onThrottleInterval`: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. NOTE: You cannot specify `notify_when` at both the rule and action level. The recommended method is to set it for each action. If you set it at the rule level then update the rule in Kibana, it is automatically changed to use action-specific values.", + "enum": [ + "onActionGroupChange", + "onActiveAlert", + "onThrottleInterval" + ], + "nullable": true, + "type": "string" + }, + "params": { + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" }, "revision": { "description": "The rule revision number.", @@ -6000,292 +5151,9 @@ "type": "string" }, "params": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "aggregationType": { - "enum": [ - "avg", - "95th", - "99th" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "aggregationType", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "anomalyDetectorTypes": { - "items": { - "enum": [ - "txLatency", - "txThroughput", - "txFailureRate" - ], - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "anomalySeverityType": { - "enum": [ - "critical", - "major", - "minor", - "warning" - ], - "type": "string" - }, - "environment": { - "type": "string" - }, - "serviceName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "environment", - "anomalySeverityType" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "errorGroupingKey": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "environment": { - "type": "string" - }, - "groupBy": { - "items": { - "type": "string" - }, - "type": "array" - }, - "searchConfiguration": { - "additionalProperties": false, - "properties": { - "query": { - "additionalProperties": false, - "properties": { - "language": { - "type": "string" - }, - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": {}, - "type": "object" - } - ] - } - }, - "required": [ - "query", - "language" - ], - "type": "object" - } - }, - "required": [ - "query" - ], - "type": "object" - }, - "serviceName": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "transactionName": { - "type": "string" - }, - "transactionType": { - "type": "string" - }, - "useKqlFilter": { - "type": "boolean" - }, - "windowSize": { - "type": "number" - }, - "windowUnit": { - "type": "string" - } - }, - "required": [ - "windowSize", - "windowUnit", - "threshold", - "environment" - ], - "type": "object" - }, - { - "additionalProperties": {}, - "description": "The parameters for the rule.", - "type": "object" - } - ] + "additionalProperties": {}, + "description": "The parameters for the rule.", + "type": "object" }, "revision": { "description": "The rule revision number.", From 117c797602f3132dc8b8617a333b204b8d763b36 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 23 Dec 2024 13:51:05 +0000 Subject: [PATCH 12/15] [CI] Auto-commit changed files from 'make api-docs' --- oas_docs/output/kibana.serverless.yaml | 760 +------------------------ oas_docs/output/kibana.yaml | 760 +------------------------ 2 files changed, 24 insertions(+), 1496 deletions(-) diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 34d5ad01b8505..2a942bc85c3bc 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -1211,193 +1211,9 @@ paths: nullable: true type: string params: - anyOf: - - additionalProperties: false - type: object - properties: - aggregationType: - enum: - - avg - - 95th - - 99th - type: string - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - aggregationType - - environment - - additionalProperties: false - type: object - properties: - anomalyDetectorTypes: - items: - enum: - - txLatency - - txThroughput - - txFailureRate - type: string - minItems: 1 - type: array - anomalySeverityType: - enum: - - critical - - major - - minor - - warning - type: string - environment: - type: string - serviceName: - type: string - transactionType: - type: string - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - environment - - anomalySeverityType - - additionalProperties: false - type: object - properties: - environment: - type: string - errorGroupingKey: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: false - type: object - properties: - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: {} - description: The parameters for the rule. - type: object + additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -2300,193 +2116,9 @@ paths: nullable: true type: string params: - anyOf: - - additionalProperties: false - type: object - properties: - aggregationType: - enum: - - avg - - 95th - - 99th - type: string - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - aggregationType - - environment - - additionalProperties: false - type: object - properties: - anomalyDetectorTypes: - items: - enum: - - txLatency - - txThroughput - - txFailureRate - type: string - minItems: 1 - type: array - anomalySeverityType: - enum: - - critical - - major - - minor - - warning - type: string - environment: - type: string - serviceName: - type: string - transactionType: - type: string - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - environment - - anomalySeverityType - - additionalProperties: false - type: object - properties: - environment: - type: string - errorGroupingKey: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: false - type: object - properties: - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: {} - description: The parameters for the rule. - type: object + additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -3364,193 +2996,9 @@ paths: nullable: true type: string params: - anyOf: - - additionalProperties: false - type: object - properties: - aggregationType: - enum: - - avg - - 95th - - 99th - type: string - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - aggregationType - - environment - - additionalProperties: false - type: object - properties: - anomalyDetectorTypes: - items: - enum: - - txLatency - - txThroughput - - txFailureRate - type: string - minItems: 1 - type: array - anomalySeverityType: - enum: - - critical - - major - - minor - - warning - type: string - environment: - type: string - serviceName: - type: string - transactionType: - type: string - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - environment - - anomalySeverityType - - additionalProperties: false - type: object - properties: - environment: - type: string - errorGroupingKey: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: false - type: object - properties: - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: {} - description: The parameters for the rule. - type: object + additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -4532,193 +3980,9 @@ paths: nullable: true type: string params: - anyOf: - - additionalProperties: false - type: object - properties: - aggregationType: - enum: - - avg - - 95th - - 99th - type: string - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - aggregationType - - environment - - additionalProperties: false - type: object - properties: - anomalyDetectorTypes: - items: - enum: - - txLatency - - txThroughput - - txFailureRate - type: string - minItems: 1 - type: array - anomalySeverityType: - enum: - - critical - - major - - minor - - warning - type: string - environment: - type: string - serviceName: - type: string - transactionType: - type: string - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - environment - - anomalySeverityType - - additionalProperties: false - type: object - properties: - environment: - type: string - errorGroupingKey: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: false - type: object - properties: - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: {} - description: The parameters for the rule. - type: object + additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 57d970b8015c9..5845ba56ae895 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -1564,193 +1564,9 @@ paths: nullable: true type: string params: - anyOf: - - additionalProperties: false - type: object - properties: - aggregationType: - enum: - - avg - - 95th - - 99th - type: string - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - aggregationType - - environment - - additionalProperties: false - type: object - properties: - anomalyDetectorTypes: - items: - enum: - - txLatency - - txThroughput - - txFailureRate - type: string - minItems: 1 - type: array - anomalySeverityType: - enum: - - critical - - major - - minor - - warning - type: string - environment: - type: string - serviceName: - type: string - transactionType: - type: string - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - environment - - anomalySeverityType - - additionalProperties: false - type: object - properties: - environment: - type: string - errorGroupingKey: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: false - type: object - properties: - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: {} - description: The parameters for the rule. - type: object + additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -2652,193 +2468,9 @@ paths: nullable: true type: string params: - anyOf: - - additionalProperties: false - type: object - properties: - aggregationType: - enum: - - avg - - 95th - - 99th - type: string - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - aggregationType - - environment - - additionalProperties: false - type: object - properties: - anomalyDetectorTypes: - items: - enum: - - txLatency - - txThroughput - - txFailureRate - type: string - minItems: 1 - type: array - anomalySeverityType: - enum: - - critical - - major - - minor - - warning - type: string - environment: - type: string - serviceName: - type: string - transactionType: - type: string - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - environment - - anomalySeverityType - - additionalProperties: false - type: object - properties: - environment: - type: string - errorGroupingKey: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: false - type: object - properties: - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: {} - description: The parameters for the rule. - type: object + additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -3715,193 +3347,9 @@ paths: nullable: true type: string params: - anyOf: - - additionalProperties: false - type: object - properties: - aggregationType: - enum: - - avg - - 95th - - 99th - type: string - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - aggregationType - - environment - - additionalProperties: false - type: object - properties: - anomalyDetectorTypes: - items: - enum: - - txLatency - - txThroughput - - txFailureRate - type: string - minItems: 1 - type: array - anomalySeverityType: - enum: - - critical - - major - - minor - - warning - type: string - environment: - type: string - serviceName: - type: string - transactionType: - type: string - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - environment - - anomalySeverityType - - additionalProperties: false - type: object - properties: - environment: - type: string - errorGroupingKey: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: false - type: object - properties: - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: {} - description: The parameters for the rule. - type: object + additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number @@ -4875,193 +4323,9 @@ paths: nullable: true type: string params: - anyOf: - - additionalProperties: false - type: object - properties: - aggregationType: - enum: - - avg - - 95th - - 99th - type: string - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - aggregationType - - environment - - additionalProperties: false - type: object - properties: - anomalyDetectorTypes: - items: - enum: - - txLatency - - txThroughput - - txFailureRate - type: string - minItems: 1 - type: array - anomalySeverityType: - enum: - - critical - - major - - minor - - warning - type: string - environment: - type: string - serviceName: - type: string - transactionType: - type: string - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - environment - - anomalySeverityType - - additionalProperties: false - type: object - properties: - environment: - type: string - errorGroupingKey: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: false - type: object - properties: - environment: - type: string - groupBy: - items: - type: string - type: array - searchConfiguration: - additionalProperties: false - type: object - properties: - query: - additionalProperties: false - type: object - properties: - language: - type: string - query: - anyOf: - - type: string - - additionalProperties: {} - type: object - required: - - query - - language - required: - - query - serviceName: - type: string - threshold: - type: number - transactionName: - type: string - transactionType: - type: string - useKqlFilter: - type: boolean - windowSize: - type: number - windowUnit: - type: string - required: - - windowSize - - windowUnit - - threshold - - environment - - additionalProperties: {} - description: The parameters for the rule. - type: object + additionalProperties: {} + description: The parameters for the rule. + type: object revision: description: The rule revision number. type: number From e84196b8d4a4713a1d5195a1ba6d35ec67d72dc0 Mon Sep 17 00:00:00 2001 From: Janki Salvi Date: Thu, 2 Jan 2025 12:07:43 +0000 Subject: [PATCH 13/15] move rule params package to shared --- package.json | 2 +- .../{private => shared}/response-ops/rule_params/README.md | 0 .../shared}/response-ops/rule_params/apm_anomaly/index.ts | 0 .../shared}/response-ops/rule_params/apm_anomaly/latest.ts | 0 .../shared}/response-ops/rule_params/apm_anomaly/v1.ts | 0 .../packages/shared}/response-ops/rule_params/common/index.ts | 0 .../rule_params/common/search_configuration_schema.ts | 0 .../shared}/response-ops/rule_params/error_count/index.ts | 0 .../shared}/response-ops/rule_params/error_count/latest.ts | 0 .../shared}/response-ops/rule_params/error_count/v1.ts | 0 .../{private => shared}/response-ops/rule_params/index.ts | 0 .../response-ops/rule_params/jest.config.js | 2 +- .../{private => shared}/response-ops/rule_params/kibana.jsonc | 0 .../packages/shared/response-ops/rule_params}/latest.ts | 0 .../{private => shared}/response-ops/rule_params/package.json | 0 .../response-ops/rule_params/transaction_duration/index.ts | 0 .../response-ops/rule_params/transaction_duration}/latest.ts | 0 .../response-ops/rule_params/transaction_duration/v1.ts | 0 .../response-ops/rule_params/transaction_error_rate/index.ts | 0 .../rule_params/transaction_error_rate}/latest.ts | 0 .../response-ops/rule_params/transaction_error_rate/v1.ts | 0 .../response-ops/rule_params/tsconfig.json | 0 .../{private => shared}/response-ops/rule_params/v1.ts | 0 tsconfig.base.json | 4 ++-- yarn.lock | 2 +- 25 files changed, 5 insertions(+), 5 deletions(-) rename src/platform/packages/{private => shared}/response-ops/rule_params/README.md (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/apm_anomaly/index.ts (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/apm_anomaly/latest.ts (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/apm_anomaly/v1.ts (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/common/index.ts (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/common/search_configuration_schema.ts (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/error_count/index.ts (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/error_count/latest.ts (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/error_count/v1.ts (100%) rename src/platform/packages/{private => shared}/response-ops/rule_params/index.ts (100%) rename src/platform/packages/{private => shared}/response-ops/rule_params/jest.config.js (87%) rename src/platform/packages/{private => shared}/response-ops/rule_params/kibana.jsonc (100%) rename {packages/response-ops/rule_params/transaction_duration => src/platform/packages/shared/response-ops/rule_params}/latest.ts (100%) rename src/platform/packages/{private => shared}/response-ops/rule_params/package.json (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/transaction_duration/index.ts (100%) rename {packages/response-ops/rule_params/transaction_error_rate => src/platform/packages/shared/response-ops/rule_params/transaction_duration}/latest.ts (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/transaction_duration/v1.ts (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/transaction_error_rate/index.ts (100%) rename src/platform/packages/{private/response-ops/rule_params => shared/response-ops/rule_params/transaction_error_rate}/latest.ts (100%) rename {packages => src/platform/packages/shared}/response-ops/rule_params/transaction_error_rate/v1.ts (100%) rename src/platform/packages/{private => shared}/response-ops/rule_params/tsconfig.json (100%) rename src/platform/packages/{private => shared}/response-ops/rule_params/v1.ts (100%) diff --git a/package.json b/package.json index f94ea7e667dfb..8425f955d8c2c 100644 --- a/package.json +++ b/package.json @@ -764,7 +764,7 @@ "@kbn/resolver-test-plugin": "link:x-pack/test/plugin_functional/plugins/resolver_test", "@kbn/response-ops-feature-flag-service": "link:packages/response-ops/feature_flag_service", "@kbn/response-ops-rule-form": "link:packages/response-ops/rule_form", - "@kbn/response-ops-rule-params": "link:src/platform/packages/private/response-ops/rule_params", + "@kbn/response-ops-rule-params": "link:src/platform/packages/shared/response-ops/rule_params", "@kbn/response-stream-plugin": "link:examples/response_stream", "@kbn/rison": "link:src/platform/packages/shared/kbn-rison", "@kbn/rollup": "link:x-pack/platform/packages/private/rollup", diff --git a/src/platform/packages/private/response-ops/rule_params/README.md b/src/platform/packages/shared/response-ops/rule_params/README.md similarity index 100% rename from src/platform/packages/private/response-ops/rule_params/README.md rename to src/platform/packages/shared/response-ops/rule_params/README.md diff --git a/packages/response-ops/rule_params/apm_anomaly/index.ts b/src/platform/packages/shared/response-ops/rule_params/apm_anomaly/index.ts similarity index 100% rename from packages/response-ops/rule_params/apm_anomaly/index.ts rename to src/platform/packages/shared/response-ops/rule_params/apm_anomaly/index.ts diff --git a/packages/response-ops/rule_params/apm_anomaly/latest.ts b/src/platform/packages/shared/response-ops/rule_params/apm_anomaly/latest.ts similarity index 100% rename from packages/response-ops/rule_params/apm_anomaly/latest.ts rename to src/platform/packages/shared/response-ops/rule_params/apm_anomaly/latest.ts diff --git a/packages/response-ops/rule_params/apm_anomaly/v1.ts b/src/platform/packages/shared/response-ops/rule_params/apm_anomaly/v1.ts similarity index 100% rename from packages/response-ops/rule_params/apm_anomaly/v1.ts rename to src/platform/packages/shared/response-ops/rule_params/apm_anomaly/v1.ts diff --git a/packages/response-ops/rule_params/common/index.ts b/src/platform/packages/shared/response-ops/rule_params/common/index.ts similarity index 100% rename from packages/response-ops/rule_params/common/index.ts rename to src/platform/packages/shared/response-ops/rule_params/common/index.ts diff --git a/packages/response-ops/rule_params/common/search_configuration_schema.ts b/src/platform/packages/shared/response-ops/rule_params/common/search_configuration_schema.ts similarity index 100% rename from packages/response-ops/rule_params/common/search_configuration_schema.ts rename to src/platform/packages/shared/response-ops/rule_params/common/search_configuration_schema.ts diff --git a/packages/response-ops/rule_params/error_count/index.ts b/src/platform/packages/shared/response-ops/rule_params/error_count/index.ts similarity index 100% rename from packages/response-ops/rule_params/error_count/index.ts rename to src/platform/packages/shared/response-ops/rule_params/error_count/index.ts diff --git a/packages/response-ops/rule_params/error_count/latest.ts b/src/platform/packages/shared/response-ops/rule_params/error_count/latest.ts similarity index 100% rename from packages/response-ops/rule_params/error_count/latest.ts rename to src/platform/packages/shared/response-ops/rule_params/error_count/latest.ts diff --git a/packages/response-ops/rule_params/error_count/v1.ts b/src/platform/packages/shared/response-ops/rule_params/error_count/v1.ts similarity index 100% rename from packages/response-ops/rule_params/error_count/v1.ts rename to src/platform/packages/shared/response-ops/rule_params/error_count/v1.ts diff --git a/src/platform/packages/private/response-ops/rule_params/index.ts b/src/platform/packages/shared/response-ops/rule_params/index.ts similarity index 100% rename from src/platform/packages/private/response-ops/rule_params/index.ts rename to src/platform/packages/shared/response-ops/rule_params/index.ts diff --git a/src/platform/packages/private/response-ops/rule_params/jest.config.js b/src/platform/packages/shared/response-ops/rule_params/jest.config.js similarity index 87% rename from src/platform/packages/private/response-ops/rule_params/jest.config.js rename to src/platform/packages/shared/response-ops/rule_params/jest.config.js index 76636c7d4fc78..6df21724dbd84 100644 --- a/src/platform/packages/private/response-ops/rule_params/jest.config.js +++ b/src/platform/packages/shared/response-ops/rule_params/jest.config.js @@ -10,5 +10,5 @@ module.exports = { preset: '@kbn/test/jest_node', rootDir: '../../../../../..', - roots: ['/src/platform/packages/private/response-ops/rule_params'], + roots: ['/src/platform/packages/shared/response-ops/rule_params'], }; diff --git a/src/platform/packages/private/response-ops/rule_params/kibana.jsonc b/src/platform/packages/shared/response-ops/rule_params/kibana.jsonc similarity index 100% rename from src/platform/packages/private/response-ops/rule_params/kibana.jsonc rename to src/platform/packages/shared/response-ops/rule_params/kibana.jsonc diff --git a/packages/response-ops/rule_params/transaction_duration/latest.ts b/src/platform/packages/shared/response-ops/rule_params/latest.ts similarity index 100% rename from packages/response-ops/rule_params/transaction_duration/latest.ts rename to src/platform/packages/shared/response-ops/rule_params/latest.ts diff --git a/src/platform/packages/private/response-ops/rule_params/package.json b/src/platform/packages/shared/response-ops/rule_params/package.json similarity index 100% rename from src/platform/packages/private/response-ops/rule_params/package.json rename to src/platform/packages/shared/response-ops/rule_params/package.json diff --git a/packages/response-ops/rule_params/transaction_duration/index.ts b/src/platform/packages/shared/response-ops/rule_params/transaction_duration/index.ts similarity index 100% rename from packages/response-ops/rule_params/transaction_duration/index.ts rename to src/platform/packages/shared/response-ops/rule_params/transaction_duration/index.ts diff --git a/packages/response-ops/rule_params/transaction_error_rate/latest.ts b/src/platform/packages/shared/response-ops/rule_params/transaction_duration/latest.ts similarity index 100% rename from packages/response-ops/rule_params/transaction_error_rate/latest.ts rename to src/platform/packages/shared/response-ops/rule_params/transaction_duration/latest.ts diff --git a/packages/response-ops/rule_params/transaction_duration/v1.ts b/src/platform/packages/shared/response-ops/rule_params/transaction_duration/v1.ts similarity index 100% rename from packages/response-ops/rule_params/transaction_duration/v1.ts rename to src/platform/packages/shared/response-ops/rule_params/transaction_duration/v1.ts diff --git a/packages/response-ops/rule_params/transaction_error_rate/index.ts b/src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/index.ts similarity index 100% rename from packages/response-ops/rule_params/transaction_error_rate/index.ts rename to src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/index.ts diff --git a/src/platform/packages/private/response-ops/rule_params/latest.ts b/src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/latest.ts similarity index 100% rename from src/platform/packages/private/response-ops/rule_params/latest.ts rename to src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/latest.ts diff --git a/packages/response-ops/rule_params/transaction_error_rate/v1.ts b/src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/v1.ts similarity index 100% rename from packages/response-ops/rule_params/transaction_error_rate/v1.ts rename to src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/v1.ts diff --git a/src/platform/packages/private/response-ops/rule_params/tsconfig.json b/src/platform/packages/shared/response-ops/rule_params/tsconfig.json similarity index 100% rename from src/platform/packages/private/response-ops/rule_params/tsconfig.json rename to src/platform/packages/shared/response-ops/rule_params/tsconfig.json diff --git a/src/platform/packages/private/response-ops/rule_params/v1.ts b/src/platform/packages/shared/response-ops/rule_params/v1.ts similarity index 100% rename from src/platform/packages/private/response-ops/rule_params/v1.ts rename to src/platform/packages/shared/response-ops/rule_params/v1.ts diff --git a/tsconfig.base.json b/tsconfig.base.json index 0bc6612af95f5..622ffc4fdcd80 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1498,8 +1498,8 @@ "@kbn/response-ops-feature-flag-service/*": ["packages/response-ops/feature_flag_service/*"], "@kbn/response-ops-rule-form": ["packages/response-ops/rule_form"], "@kbn/response-ops-rule-form/*": ["packages/response-ops/rule_form/*"], - "@kbn/response-ops-rule-params": ["src/platform/packages/private/response-ops/rule_params"], - "@kbn/response-ops-rule-params/*": ["src/platform/packages/private/response-ops/rule_params/*"], + "@kbn/response-ops-rule-params": ["src/platform/packages/shared/response-ops/rule_params"], + "@kbn/response-ops-rule-params/*": ["src/platform/packages/shared/response-ops/rule_params/*"], "@kbn/response-stream-plugin": ["examples/response_stream"], "@kbn/response-stream-plugin/*": ["examples/response_stream/*"], "@kbn/rison": ["src/platform/packages/shared/kbn-rison"], diff --git a/yarn.lock b/yarn.lock index d5579517ef207..cbe251e70e789 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6813,7 +6813,7 @@ version "0.0.0" uid "" -"@kbn/response-ops-rule-params@link:src/platform/packages/private/response-ops/rule_params": +"@kbn/response-ops-rule-params@link:src/platform/packages/shared/response-ops/rule_params": version "0.0.0" uid "" From 35e8e62a1fbf606e42cbd9ef0b36d07a7a00e26c Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:16:39 +0000 Subject: [PATCH 14/15] [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs' --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0d183058acb22..17626aa7116d2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -515,7 +515,6 @@ src/platform/packages/private/kbn-repo-packages @elastic/kibana-operations src/platform/packages/private/kbn-ui-shared-deps-npm @elastic/kibana-operations src/platform/packages/private/kbn-ui-shared-deps-src @elastic/kibana-operations src/platform/packages/private/kbn-unsaved-changes-badge @elastic/kibana-data-discovery -src/platform/packages/private/response-ops/rule_params @elastic/response-ops src/platform/packages/shared/deeplinks/analytics @elastic/kibana-data-discovery @elastic/kibana-presentation @elastic/kibana-visualizations src/platform/packages/shared/deeplinks/devtools @elastic/kibana-management src/platform/packages/shared/deeplinks/fleet @elastic/fleet @@ -601,6 +600,7 @@ src/platform/packages/shared/kbn-xstate-utils @elastic/obs-ux-logs-team src/platform/packages/shared/kbn-zod-helpers @elastic/security-detection-rule-management src/platform/packages/shared/presentation/presentation_containers @elastic/kibana-presentation src/platform/packages/shared/presentation/presentation_publishing @elastic/kibana-presentation +src/platform/packages/shared/response-ops/rule_params @elastic/response-ops src/platform/packages/shared/serverless/settings/search_project @elastic/search-kibana @elastic/kibana-management src/platform/packages/shared/serverless/settings/security_project @elastic/security-solution @elastic/kibana-management src/platform/plugins/private/input_control_vis @elastic/kibana-presentation From 12a9e522b61950ad6003a5d7c8dfeebbdca81759 Mon Sep 17 00:00:00 2001 From: Janki Salvi Date: Thu, 2 Jan 2025 14:38:30 +0000 Subject: [PATCH 15/15] lint fix --- .../plugins/apm/common/rules/apm_rule_types.ts | 8 ++++---- .../rule_types/anomaly/register_anomaly_rule_type.ts | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/x-pack/solutions/observability/plugins/apm/common/rules/apm_rule_types.ts b/x-pack/solutions/observability/plugins/apm/common/rules/apm_rule_types.ts index 5354ab7082908..d1629348a4e23 100644 --- a/x-pack/solutions/observability/plugins/apm/common/rules/apm_rule_types.ts +++ b/x-pack/solutions/observability/plugins/apm/common/rules/apm_rule_types.ts @@ -13,10 +13,10 @@ import { formatDurationFromTimeUnitChar } from '@kbn/observability-plugin/common import { ML_ANOMALY_SEVERITY } from '@kbn/ml-anomaly-utils/anomaly_severity'; import { ML_ANOMALY_THRESHOLD } from '@kbn/ml-anomaly-utils/anomaly_threshold'; import { ApmRuleType } from '@kbn/rule-data-utils'; -import { ErrorCountRuleParams } from '@kbn/response-ops-rule-params/error_count'; -import { TransactionDurationRuleParams } from '@kbn/response-ops-rule-params/transaction_duration'; -import { AnomalyRuleParams } from '@kbn/response-ops-rule-params/apm_anomaly'; -import { TransactionErrorRateRuleParams } from '@kbn/response-ops-rule-params/transaction_error_rate'; +import type { ErrorCountRuleParams } from '@kbn/response-ops-rule-params/error_count'; +import type { TransactionDurationRuleParams } from '@kbn/response-ops-rule-params/transaction_duration'; +import type { AnomalyRuleParams } from '@kbn/response-ops-rule-params/apm_anomaly'; +import type { TransactionErrorRateRuleParams } from '@kbn/response-ops-rule-params/transaction_error_rate'; import { ERROR_GROUP_ID, ERROR_GROUP_NAME, diff --git a/x-pack/solutions/observability/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts b/x-pack/solutions/observability/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts index e18c8e5087e60..4c3baac28c6a0 100644 --- a/x-pack/solutions/observability/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts +++ b/x-pack/solutions/observability/plugins/apm/server/routes/alerts/rule_types/anomaly/register_anomaly_rule_type.ts @@ -48,11 +48,13 @@ import { getEnvironmentEsField, getEnvironmentLabel, } from '../../../../../common/environment_filter_values'; -import type { THRESHOLD_MET_GROUP } from '../../../../../common/rules/apm_rule_types'; +import type { + THRESHOLD_MET_GROUP, + ApmRuleParamsType, +} from '../../../../../common/rules/apm_rule_types'; import { ANOMALY_ALERT_SEVERITY_TYPES, APM_SERVER_FEATURE_ID, - ApmRuleParamsType, formatAnomalyReason, RULE_TYPES_CONFIG, } from '../../../../../common/rules/apm_rule_types';