-
Notifications
You must be signed in to change notification settings - Fork 96
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
metrics-http-json-deep.rb not working #48
Labels
Comments
For anyone else who is googling this: Source: curl -s http://0.0.0.0:9292/health| python -mjson.tool
{
"queue_depth": {
"connector_worker_pool": 0,
"publisher_pool": 0,
"status_updater_pool": 0
}
} Error:
Solution: metrics-http-json-deep.rb --port 9292 --path health --root 'queue_depth'
ubuntu.json.connector_worker_pool 0 1470950544
ubuntu.json.publisher_pool 0 1470950544
ubuntu.json.status_updater_pool 0 1470950544 |
Is this still an issue? |
@ghettodev could you put together a pr to document this useage? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've been having a difficult time with the metrics-http-json-deep.rb check. I am trying to use it to collect metrics reported in JSON over HTTP in order to send them to graphite. When I run it against a simple JSON message with just two key/value pairs (like http://echo.jsontest.com/key/value/one/two), I get the following error:
Check failed to run: undefined method
each' for nil:NilClass, ["/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-http-1.0.0/bin/metrics-http-json-deep.rb:81:indeep_value'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-http-1.0.0/bin/metrics-http-json-deep.rb:119:in
run'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.2.0/lib/sensu-plugin/cli.rb:56:inblock in <class:CLI>'"]
With more complex JSON messages, such as the output I'm actually trying to record, I get this error:
Check failed to run: no implicit conversion of Regexp into String, ["/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-http-1.0.0/bin/metrics-http-json-deep.rb:82:in
tr'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-http-1.0.0/bin/metrics-http-json-deep.rb:82:inblock in deep_value'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-http-1.0.0/bin/metrics-http-json-deep.rb:81:in
each'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-http-1.0.0/bin/metrics-http-json-deep.rb:81:indeep_value'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-http-1.0.0/bin/metrics-http-json-deep.rb:119:in
run'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.2.0/lib/sensu-plugin/cli.rb:56:inblock in <class:CLI>'"]
I installed the check using
sensu-install
, if that helps. Any idea what the issue could be here? Would greatly appreciate any help debugging this.The text was updated successfully, but these errors were encountered: