forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ResponseOps][Rules] Move APM rule types params to the @kbn/response-…
…ops-rule-params package (elastic#204637) ## Summary Resolves elastic#195186 ### Checklist - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
dd78cd3
commit 45df04d
Showing
38 changed files
with
311 additions
and
48 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
src/platform/packages/private/response-ops/rule_params/tsconfig.json
This file was deleted.
Oops, something went wrong.
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
src/platform/packages/shared/response-ops/rule_params/apm_anomaly/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { anomalyParamsSchema } from './latest'; | ||
export { anomalyParamsSchema as anomalyParamsSchemaV1 } from './v1'; | ||
|
||
export type { AnomalyRuleParams } from './latest'; | ||
export type { AnomalyRuleParams as AnomalyRuleParamsV1 } from './v1'; |
File renamed without changes.
40 changes: 40 additions & 0 deletions
40
src/platform/packages/shared/response-ops/rule_params/apm_anomaly/v1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 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 type AnomalyRuleParams = TypeOf<typeof anomalyParamsSchema>; |
10 changes: 10 additions & 0 deletions
10
src/platform/packages/shared/response-ops/rule_params/common/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; |
19 changes: 19 additions & 0 deletions
19
src/platform/packages/shared/response-ops/rule_params/common/search_configuration_schema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<typeof searchConfigurationSchema>; |
14 changes: 14 additions & 0 deletions
14
src/platform/packages/shared/response-ops/rule_params/error_count/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { ErrorCountRuleParams } from './latest'; | ||
export type { ErrorCountRuleParams as ErrorCountRuleParamsV1 } from './v1'; |
10 changes: 10 additions & 0 deletions
10
src/platform/packages/shared/response-ops/rule_params/error_count/latest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; |
25 changes: 25 additions & 0 deletions
25
src/platform/packages/shared/response-ops/rule_params/error_count/v1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ErrorCountRuleParams = TypeOf<typeof errorCountParamsSchema>; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
...ate/response-ops/rule_params/kibana.jsonc → ...red/response-ops/rule_params/kibana.jsonc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
"visibility": "shared" | ||
} |
10 changes: 10 additions & 0 deletions
10
src/platform/packages/shared/response-ops/rule_params/latest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; |
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
src/platform/packages/shared/response-ops/rule_params/transaction_duration/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { transactionDurationParamsSchema } from './latest'; | ||
export { transactionDurationParamsSchema as transactionDurationParamsSchemaV1 } from './v1'; | ||
|
||
export type { TransactionDurationRuleParams } from './latest'; | ||
export type { TransactionDurationRuleParams as TransactionDurationRuleParamsV1 } from './v1'; |
10 changes: 10 additions & 0 deletions
10
src/platform/packages/shared/response-ops/rule_params/transaction_duration/latest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; |
37 changes: 37 additions & 0 deletions
37
src/platform/packages/shared/response-ops/rule_params/transaction_duration/v1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 TransactionDurationRuleParams = TypeOf<typeof transactionDurationParamsSchema>; |
14 changes: 14 additions & 0 deletions
14
src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { TransactionErrorRateRuleParams } from './latest'; | ||
export type { TransactionErrorRateRuleParams as TransactionErrorRateRuleParamsV1 } from './v1'; |
10 changes: 10 additions & 0 deletions
10
src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/latest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; |
26 changes: 26 additions & 0 deletions
26
src/platform/packages/shared/response-ops/rule_params/transaction_error_rate/v1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 TransactionErrorRateRuleParams = TypeOf<typeof transactionErrorRateParamsSchema>; |
10 changes: 10 additions & 0 deletions
10
src/platform/packages/shared/response-ops/rule_params/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../../../../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "target/types", | ||
"types": ["jest", "node"] | ||
}, | ||
"include": ["**/*.ts"], | ||
"exclude": ["target/**/*"], | ||
"kbn_references": ["@kbn/config-schema", "@kbn/ml-anomaly-utils"] | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.