Skip to content
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

[Stack Monitoring] create alert per node, index, or cluster instead of always per cluster #102544

Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8958485
create alert per node instead of per cluster
neptunian Jun 17, 2021
78ccc94
add comment
neptunian Jun 17, 2021
78882c6
fix test, replace alert state with empty array with no node is firing
neptunian Jun 17, 2021
b7fd890
update cpu usage action messaging
neptunian Jun 21, 2021
b0af3fe
fix internationalization
neptunian Jun 21, 2021
d610744
update disk usage rule action messaging
neptunian Jun 21, 2021
215e5ac
update memory usage rule action messaging
neptunian Jun 21, 2021
8087080
update other action messaging
neptunian Jun 21, 2021
2b1bf65
update missing monitoring data alert action messaging
neptunian Jun 22, 2021
42f06e8
remove comment
neptunian Jun 22, 2021
394369e
fix bug where threadpool alerts were not firing
neptunian Jun 23, 2021
853725c
fix bug with threadpool rejections and update alert action messaging …
neptunian Jun 23, 2021
65fe38b
update comments
neptunian Jun 23, 2021
4957b68
unit test for thread pool write rejections alert
neptunian Jun 23, 2021
c71347c
update messaging for CCR read rejection
neptunian Jun 24, 2021
ded697e
fix cluster level alerts to use the cluster id when its not node level
neptunian Jun 24, 2021
f9b57cd
add more tests to nodes changed alert
neptunian Jun 24, 2021
5c9f377
update default message
neptunian Jun 24, 2021
6cb2c0d
update alert messaging for large shard size
neptunian Jun 24, 2021
f3034ca
update default messaging
neptunian Jun 24, 2021
0a0b773
Merge branch 'master' into 100136-alerts-per-node-change-stack-monito…
kibanamachine Jun 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions x-pack/plugins/monitoring/server/alerts/base_alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ export class BaseAlert {
state: ExecutedState
) {
const currentUTC = +new Date();

// for each cluster filter the nodes that belong to this cluster
for (const cluster of clusters) {
const nodes = data.filter((node) => node.clusterUuid === cluster.clusterUuid);
Expand All @@ -286,7 +285,10 @@ export class BaseAlert {
// for each node, update the alert's state with node state
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is where I've moved the triggering of the new alert into the inner for loop that loops through each node, instead of in the cluster for loop.

for (const node of nodes) {
const newAlertStates: AlertNodeState[] = [];
const instance = services.alertInstanceFactory(node.meta.nodeId || node.meta.instanceId);
// quick fix for now so that non node level alerts will use the cluster id
const instance = services.alertInstanceFactory(
node.meta.nodeId || node.meta.instanceId || cluster.clusterUuid
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some alerts are cluster level and do not have a nodeId or instanceId property, so use the clusterUuid. This should be typed and improved at some point or have a different function for cluster vs node level processing.

);

if (node.shouldFire) {
const { meta } = node;
Expand Down