sensu-plugins / sensu-plugins-http

This plugin provides native HTTP instrumentation for monitoring and metrics collection, including: response code, JSON response, HTTP last modified, SSL expiry, and metrics via `curl`.
http://sensu-plugins.io
MIT License
30 stars 97 forks source link

metrics-http-json-deep filtering only integers with 'Only Numbers' flag #102

Closed korenDevops closed 5 years ago

korenDevops commented 6 years ago

From the usage of the metric check bin/metrics-http-json-deep.rb: -n, --number Output numbers only From that, using common sense (and the formal definition of the word 'number'), I infer that this check will output any type of number, and in particular, Real Numbers ! Albeit, from the code, it is clear that this option only outputs integers: output "#{scheme}.#{ekey}", value unless config[:numonly] && !value.is_a?(Integer) link

It is needed to change the line to something like: output "#{scheme}.#{ekey}", value unless config[:numonly] && !value.is_a?(Numeric) for two main reasons, the first of which and the more obvious one, mentioned above, and the second being that this change will not affect graphite values insertion, meaning the usage will not be harmed, but improved.

majormoses commented 6 years ago

fixed #103