-
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
[Monitoring] JVM memory usage alert #79039
Merged
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f8cba32
Memory usage first draft
igoristic 5320edc
Fixed tests
igoristic f08e5f6
Merge branch 'master' of https://github.com/elastic/kibana into jvm-m…
igoristic 509be7e
CR feedback
igoristic 14c456e
Merge branch 'master' of https://github.com/elastic/kibana into jvm-m…
igoristic 7ddae02
Feedback and tests
igoristic 132ca13
Merge branch 'master' of https://github.com/elastic/kibana into jvm-m…
igoristic 635dfd0
Added size to optimize query
igoristic 5d28f00
Removed scheduled check
igoristic 72823a0
Removed globalstate date
igoristic 7405c18
Merge branch 'master' of https://github.com/elastic/kibana into jvm-m…
igoristic 15dc2da
Merge branch 'master' into jvm-memory-usage
kibanamachine 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
29 changes: 29 additions & 0 deletions
29
x-pack/plugins/monitoring/public/alerts/memory_usage_alert/index.tsx
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,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { validate } from '../components/duration/validation'; | ||
import { Expression, Props } from '../components/duration/expression'; | ||
|
||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | ||
import { AlertTypeModel } from '../../../../triggers_actions_ui/public/types'; | ||
|
||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | ||
import { MemoryUsageAlert } from '../../../server/alerts'; | ||
|
||
export function createMemoryUsageAlertType(): AlertTypeModel { | ||
return { | ||
id: MemoryUsageAlert.TYPE, | ||
name: MemoryUsageAlert.LABEL, | ||
iconClass: 'bell', | ||
alertParamsExpression: (props: Props) => ( | ||
<Expression {...props} paramDetails={MemoryUsageAlert.PARAM_DETAILS} /> | ||
), | ||
validate, | ||
defaultActionMessage: '{{context.internalFullMessage}}', | ||
requiresAppContext: true, | ||
}; | ||
} |
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
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
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.
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.
Why add this?
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.
To keep it consistent with our defaults, otherwise it'll use timerange default of 15min, which will then persist to next state once they start navigating the app
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.
But our defaults are defined here: https://github.com/elastic/kibana/blob/master/x-pack/plugins/monitoring/public/plugin.ts#L134?
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.
Yeah, but it won't transfer to
url_state
unless we explicitly provide it (like I'm doing above). You can test this for yourselfThere 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.
Sorry, but I'm still not following.
This is what I'm seeing which seems fine:
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.
There isn't much to figure out. Like I said it falls back to defaults, and for me it's:
Anyways, we're digressing here. These are all trivial things that are not really related to the scope of this PR and can be addressed/debated as a separate discussion/issue
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.
My defaults are the same:
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.
It also relies on
localStorage
. Maybe try clearing it, or at least the following key:kibana.timepicker.timeHistory: "[{"from":"now-1h","to":"now"},{"from":"now-15m","to":"now"}]"
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.
I agree it isn't related to this PR and we should defer the conversation, but we should have it at some point. I'm curious if there is an actual bug around this code that we need to fix.
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.
Hey catching up on this, I think introducing more than one place to define defaults is probably not a good idea and we should understand why it's needed before we introduce that kind of foot-gun.
For now, if the goal is to get this alert in before FF, I recommend removing that line and then during the test plan phase try to understand why you both are seeing these different behaviors, and then document that back on this PR or in a new ticket. Hopefully it's not necessary at all, but if it is, we should export the defaults as a constant and then use it in both places at the very least.