Adding a new check for checking the number of shards in a cluster#108
Adding a new check for checking the number of shards in a cluster#108thomasriley wants to merge 1 commit intosensu-plugins:masterfrom
Conversation
majormoses
left a comment
There was a problem hiding this comment.
Overall looks great but I do have a couple of things that I think we should improve.
| # == Elastic Search Shard Limit Status | ||
| # | ||
| class ESShardMaximumLimit < Sensu::Plugin::Check::CLI | ||
| option :scheme, |
There was a problem hiding this comment.
I'd prefer to use protocol as scheme sounds more like the scheme in a metrics script. I would also accept uri_protocol or something like that to make it obvious to it's intent.
Also I would suggest including the only valid options like this:
option :protocol,
description: 'Protocol to make requests with',
long: '--protocol PROTO',
default: 'http',
in: %(http https)| description: 'Port', | ||
| short: '-p PORT', | ||
| long: '--port PORT', | ||
| default: '9200' |
There was a problem hiding this comment.
why is this a string this should be an integer.
| shard_count = shard_count() | ||
| node_count = node_count() | ||
| if shard_count > (node_count * config[:node_limit]) | ||
| critical "Shard count has breached the limit (#{shard_count}/#{node_count * config[:node_limit]})" |
There was a problem hiding this comment.
I think I would like to specify a warning and a critical. The reason is that if we hit 1000 we have errors but I would like to have some warning at say 800 so that we can actively spot the need to escalate to get priority work done to figure out what the solution is before we have a problem.
|
@thomasriley any chance you are coming back to this? |
Pull Request Checklist
fixes #107
General
Update Changelog following the conventions laid out here
Update README with any necessary configuration snippets
Binstubs are created if needed
RuboCop passes
Existing tests pass
Purpose
Add a new check that will alert when the number of shards in a ES cluster breaches a limit.
Known Compatibility Issues
None