-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RAC] Rule registry plugin #95903
Merged
Merged
[RAC] Rule registry plugin #95903
Changes from 39 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
456bc37
Rule registry
dgieselaar 5952259
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar b01fb63
Index alert events
dgieselaar 023fc6b
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 649eaa4
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar d7e194c
Scoped rule registry client
dgieselaar b8ae24f
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 1433e7c
Clean up APM rule type tests
dgieselaar bfe5767
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 1d656ad
create scoped client for request
dgieselaar c942603
Remove parent reference
dgieselaar 5166848
Add README
dgieselaar 008f837
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar a85cacb
Namespace alert fields
dgieselaar f64a930
Update allowed user defined alert fields
dgieselaar 3fe959e
Review feedback
dgieselaar e21813d
Namespace > name
dgieselaar 6762c6a
Add rule registry plugin to docs
dgieselaar 8344826
configurable writes
dgieselaar bd77029
Update producer field
dgieselaar 2b243f9
Revert changes to index template error
dgieselaar 94da2ca
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 7720830
Merge branch 'master' into rule-registry
kibanamachine 473dfba
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 71ec07c
Merge branch 'rule-registry' of github.com:dgieselaar/kibana into rul…
dgieselaar 260ea64
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 7df11b9
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 18c0644
Add rule registry project to apm tsconfig
dgieselaar d23e693
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar b7044e7
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 7ebaff6
Add simple integration tests for rule registry
dgieselaar 1e9f240
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 74d3edd
Revert change to getEsNames
dgieselaar 8137e1a
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 45b5fff
Add rules integration tests to config
dgieselaar 4f43921
Export APMRuleRegistry type again
dgieselaar d41d709
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 585e83a
Lowercase index alias name
dgieselaar 36d4786
Removed unused import
dgieselaar 31f97de
Include alert types in SO client
dgieselaar d3848c9
Merge branch 'master' of github.com:elastic/kibana into rule-registry
dgieselaar 11679ef
Use wildcard to prevent version mismatch in index target
dgieselaar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -22,11 +22,13 @@ const environmentLabels: Record<string, string> = { | |
}; | ||
|
||
export const ENVIRONMENT_ALL = { | ||
esFieldValue: undefined, | ||
value: ENVIRONMENT_ALL_VALUE, | ||
text: environmentLabels[ENVIRONMENT_ALL_VALUE], | ||
}; | ||
|
||
export const ENVIRONMENT_NOT_DEFINED = { | ||
esFieldValue: undefined, | ||
value: ENVIRONMENT_NOT_DEFINED_VALUE, | ||
text: environmentLabels[ENVIRONMENT_NOT_DEFINED_VALUE], | ||
}; | ||
|
@@ -35,6 +37,22 @@ export function getEnvironmentLabel(environment: string) { | |
return environmentLabels[environment] || environment; | ||
} | ||
|
||
export function parseEnvironmentUrlParam(environment: string) { | ||
if (environment === ENVIRONMENT_ALL_VALUE) { | ||
return ENVIRONMENT_ALL; | ||
} | ||
|
||
if (environment === ENVIRONMENT_NOT_DEFINED_VALUE) { | ||
return ENVIRONMENT_NOT_DEFINED; | ||
} | ||
|
||
return { | ||
esFieldValue: environment, | ||
value: environment, | ||
text: environment, | ||
}; | ||
} | ||
Comment on lines
+40
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Afaict this should be: export function getEsFieldValue(environment: string) {
if (environment === ENVIRONMENT_ALL_VALUE) {
return ENVIRONMENT_ALL;
}
if (environment === ENVIRONMENT_NOT_DEFINED_VALUE) {
return ENVIRONMENT_NOT_DEFINED;
}
return environment
} Then you can call it the specific places where needed (currently just for alerts) |
||
|
||
// returns the environment url param that should be used | ||
// based on the requested environment. If the requested | ||
// environment is different from the URL parameter, we'll | ||
|
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
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/apm/server/lib/alerts/create_apm_lifecycle_rule_type.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,11 @@ | ||
/* | ||
* 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 { createLifecycleRuleTypeFactory } from '../../../../rule_registry/server'; | ||
import { APMRuleRegistry } from '../../plugin'; | ||
|
||
export const createAPMLifecycleRuleType = createLifecycleRuleTypeFactory<APMRuleRegistry>(); |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgieselaar This (
esFieldValue
) is being passed to the DOM elements causing the following error: