-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RAC] Decouple registry from alerts-as-data client (#98935)
- Loading branch information
1 parent
ee9d469
commit bdde884
Showing
103 changed files
with
1,983 additions
and
1,853 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* 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 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 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
module.exports = { | ||
preset: '@kbn/test', | ||
rootDir: '../..', | ||
roots: ['<rootDir>/packages/kbn-rule-data-utils'], | ||
}; |
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,13 @@ | ||
{ | ||
"name": "@kbn/rule-data-utils", | ||
"main": "./target/index.js", | ||
"types": "./target/index.d.ts", | ||
"version": "1.0.0", | ||
"license": "SSPL-1.0 OR Elastic License 2.0", | ||
"private": true, | ||
"scripts": { | ||
"build": "../../node_modules/.bin/tsc", | ||
"kbn:bootstrap": "yarn build", | ||
"kbn:watch": "yarn build --watch" | ||
} | ||
} |
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,9 @@ | ||
/* | ||
* 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 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 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export * from './technical_field_names'; |
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,77 @@ | ||
/* | ||
* 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 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 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { ValuesType } from 'utility-types'; | ||
|
||
const ALERT_NAMESPACE = 'kibana.rac.alert'; | ||
|
||
const TIMESTAMP = '@timestamp' as const; | ||
const EVENT_KIND = 'event.kind' as const; | ||
const EVENT_ACTION = 'event.action' as const; | ||
const RULE_UUID = 'rule.uuid' as const; | ||
const RULE_ID = 'rule.id' as const; | ||
const RULE_NAME = 'rule.name' as const; | ||
const RULE_CATEGORY = 'rule.category' as const; | ||
const TAGS = 'tags' as const; | ||
const PRODUCER = `${ALERT_NAMESPACE}.producer` as const; | ||
const ALERT_ID = `${ALERT_NAMESPACE}.id` as const; | ||
const ALERT_UUID = `${ALERT_NAMESPACE}.uuid` as const; | ||
const ALERT_START = `${ALERT_NAMESPACE}.start` as const; | ||
const ALERT_END = `${ALERT_NAMESPACE}.end` as const; | ||
const ALERT_DURATION = `${ALERT_NAMESPACE}.duration.us` as const; | ||
const ALERT_SEVERITY_LEVEL = `${ALERT_NAMESPACE}.severity.level` as const; | ||
const ALERT_SEVERITY_VALUE = `${ALERT_NAMESPACE}.severity.value` as const; | ||
const ALERT_STATUS = `${ALERT_NAMESPACE}.status` as const; | ||
const ALERT_EVALUATION_THRESHOLD = `${ALERT_NAMESPACE}.evaluation.threshold` as const; | ||
const ALERT_EVALUATION_VALUE = `${ALERT_NAMESPACE}.evaluation.value` as const; | ||
|
||
const fields = { | ||
TIMESTAMP, | ||
EVENT_KIND, | ||
EVENT_ACTION, | ||
RULE_UUID, | ||
RULE_ID, | ||
RULE_NAME, | ||
RULE_CATEGORY, | ||
TAGS, | ||
PRODUCER, | ||
ALERT_ID, | ||
ALERT_UUID, | ||
ALERT_START, | ||
ALERT_END, | ||
ALERT_DURATION, | ||
ALERT_SEVERITY_LEVEL, | ||
ALERT_SEVERITY_VALUE, | ||
ALERT_STATUS, | ||
ALERT_EVALUATION_THRESHOLD, | ||
ALERT_EVALUATION_VALUE, | ||
}; | ||
|
||
export { | ||
TIMESTAMP, | ||
EVENT_KIND, | ||
EVENT_ACTION, | ||
RULE_UUID, | ||
RULE_ID, | ||
RULE_NAME, | ||
RULE_CATEGORY, | ||
TAGS, | ||
PRODUCER, | ||
ALERT_ID, | ||
ALERT_UUID, | ||
ALERT_START, | ||
ALERT_END, | ||
ALERT_DURATION, | ||
ALERT_SEVERITY_LEVEL, | ||
ALERT_SEVERITY_VALUE, | ||
ALERT_STATUS, | ||
ALERT_EVALUATION_THRESHOLD, | ||
ALERT_EVALUATION_VALUE, | ||
}; | ||
|
||
export type TechnicalRuleDataFieldName = ValuesType<typeof fields>; |
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 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"incremental": false, | ||
"outDir": "./target", | ||
"stripInternal": false, | ||
"declaration": true, | ||
"declarationMap": true, | ||
"sourceMap": true, | ||
"sourceRoot": "../../../../packages/kbn-rule-data-utils/src", | ||
"types": [ | ||
"jest", | ||
"node" | ||
] | ||
}, | ||
"include": [ | ||
"./src/**/*.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
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.