Skip to content
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

Add -x option to graphite.rb plugin to allow complex queries with graphite functions #1239

Closed
wants to merge 5 commits into from

Conversation

jennytoo
Copy link

This is a simple patch which adds a new option, -x / --complex_target, which disables splitting the target on commas, thus allowing complex targets which contain functions with multiple parameters.

A censored example showing how useSeriesAbove can be used to only alert when a server has been up at least 1200 seconds:

plugins/graphite/graphite.rb -h graphite.example -t 'nonNegativeDerivative(useSeriesAbove(example.server*.uptime, 1200, "uptime", "requests"))' -a 1,1 -g -x
Graphite CRITICAL: The average value of metric nonNegativeDerivative(example.server1.requests) is 372162.7358490566 that is greater than allowed average of 1
The average value of metric nonNegativeDerivative(example.server2.requests) is 220345.547008547 that is greater than allowed average of 1

@jennytoo
Copy link
Author

The three failing checks are in files I've not touched. One is an easy fix, but I don't know what to do about the others - there's already rubocop disable statements on both of them and rubocop on my system is honoring them. I'd guess the version of rubocop being used is using a different name for the checks that are alerting.

Looks like Style/Semicolon doesn't work for disabling in the version
being used. Both disable Style/Semicolon and disable Semicolon work on my
machine.
@jennytoo
Copy link
Author

Okay, alternate form of the existing disable check fixed it, plus fixed up a fourth rubocop error that my copy was reporting.

@jennytoo
Copy link
Author

It turns out someone else also opened a pull request, #1228, to fix the rubocop errors but it hasn't been merged yet.

@jennytoo
Copy link
Author

It looks like this has been moved to sensu-plugins/sensu-plugins-graphite, so I've created sensu-plugins/sensu-plugins-graphite#13 against that repo.

@jennytoo jennytoo closed this Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant