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

--until isn't included when retrieving data #58

Open
inno-ron opened this issue Oct 19, 2017 · 5 comments
Open

--until isn't included when retrieving data #58

inno-ron opened this issue Oct 19, 2017 · 5 comments

Comments

@inno-ron
Copy link

Seems like the SensuPluginsGraphite::GraphiteProxy.retrieve_data! does not taking the config[:until] value when building the url.

Aka, running a graphite check with
--target 'my.metric&until=-2hours isn't like running --target 'my.metric' --until -2hours

@majormoses
Copy link
Member

Can you please reference a specific check I am not seeing a --until option.

@inno-ron
Copy link
Author

inno-ron commented Nov 6, 2017

hi @majormoses , I am referring to check-graphite-data but the issue is in the core code that retrieving the graphite url of a check. If you'll check out lib/sensu-plugins-graphite/graphite_proxy/proxy.rb you would see the following line in retrieve_data function, on line 82:
url = "#{config[:server]}/render?format=json&target=#{formatted_target}&from=#{config[:from]}" this url missing the following: &until=#{config[:until]} and therefor whoever passes a --until to the check-graphite-data command doesn't affect the check url itself.

@majormoses
Copy link
Member

I see, thanks for clarifying. I validated your findings are correct and should be pretty easy to fix. Any chance you would be willing to submit a PR to fix this?

@inno-ron
Copy link
Author

inno-ron commented Nov 7, 2017

@majormoses sure thing. will ping here when done.

@inno-ron
Copy link
Author

inno-ron commented Nov 7, 2017

@majormoses pull request has been created #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants