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.
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
Mysql select value check #84
base: master
Are you sure you want to change the base?
Mysql select value check #84
Changes from all commits
b4e103c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
While I think this is a clever way to solve the problem I generally find it's not a good idea to do this kind of auto detection as you can't validate that its been configured correctly. Perhaps passing in a
--threshold-type
(or similar) with an option list would be better. If someone wants to check if something is greater than and thecritical
threshold is lower than thewarning
threshold we should return anunknown
as we can't determine if this is intentional or a misconfiguration. Having people be explicit what they want removes the ambiguity and makes it easier to stop bad configuration from alerting people. Here is an example of passing in a list of acceptable arguments: https://github.com/sensu-plugins/sensu-plugins-redis/blob/3.0.1/lib/redis_client_options.rb#L75. Also if you set thewarning
threshold to be the same as thecritical
this will default to lower which I am not sure is the right default.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.
Agreed. Will change.
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.
having the tripped threshold in the message seems redundant as it will start with the severity. Also not sure we really need to change
"beyond"
conditionally I think a more generic word such asexceeded
would cover it, if you want to say do a hash lookup based on the type of threshold passed in I am less opposed I just find that these ways of trying to auto detect things often contain subtle bugs and are hard to detect misconfiguration.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 would argue that most people would understand "value A exceeds value B" as "value A is above value B". Looking at a monitoring dashboard or a notification from a check which I might not even have configured myself, the description should tell me unambiguous what's going on. I'll redo the code with hashes, though.
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.
Fair enough though we are sacrificing a bit of code readability for the sake of being grammatically correct.