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

When using graph with graphite, from and until show how doesnt render anything when the period is smaller 12 hours. #112

Open
laapsaap opened this issue Oct 31, 2013 · 5 comments
Milestone

Comments

@laapsaap
Copy link

graphite:8080/render?from=11%3A23_20131031&until=11%3A53_20131031&format=json&target=collectd.mysql02_servername_lan.mysql.prtg.mysql_commands.%2A

When using graph with graphite, from and until somehow doesnt render anything when the period is smaller 12 hours.

So i opened development.log to see what is wrong, I just cant understand why. But what does work is using ;

from=-5minutes
from=-2hours etc

Anyways I am editing the source to use that instead, its recommended on graphite site. But really dont understand why from and until doesnt work for smaller periods.

@fdietz
Copy link
Owner

fdietz commented Nov 1, 2013

Nice finding!

@laapsaap
Copy link
Author

laapsaap commented Nov 1, 2013

Just wondering if anyone else have the same problem, so i can flag this bug at Graphite

@fdietz
Copy link
Owner

fdietz commented Nov 5, 2013

I actually had the same issue when working on the new graphite widget, but
didn't follow up on it with the Graphite Web project.

On Fri, Nov 1, 2013 at 12:25 PM, laapsaap [email protected] wrote:

Just wondering if anyone else have the same problem, so i can flag this
bug at Graphite


Reply to this email directly or view it on GitHubhttps://github.com//issues/112#issuecomment-27559746
.

@mikeforbes
Copy link

I'm getting this too - look at the URL - for some reason it's requesting %3A which is an HTML character code for a colon : instead of just using a colon.

What part of the code did you edit to fix it?

@mikeforbes
Copy link

Answering myself, and leaving this so others that might find it:

I edited team_dashboard/app/models/graphite_url_builder.rb, and changed this section:

def datapoints_svg_url(targets, from, to, options = {})
query = []
query << Array(targets).reject(&:blank?).map { |t| "target=#{CGI.escape(t)}" }
query << "from=#{CGI.escape(format(from))}"
query << "until=#{CGI.escape(format(to))}"

to:

def datapoints_svg_url(targets, from, to, options = {})
query = []
query << Array(targets).reject(&:blank?).map { |t| "target=#{CGI.escape(t)}" }
query << "from=-2hours"
query << "until=now"

There's probably a better way of doing this, but I needed it to work quickly for a demo 😁

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

No branches or pull requests

3 participants