team_dashboard icon indicating copy to clipboard operation
team_dashboard copied to clipboard

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

Open laapsaap opened this issue 11 years ago • 5 comments

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.

laapsaap avatar Oct 31 '13 16:10 laapsaap

Nice finding!

fdietz avatar Nov 01 '13 07:11 fdietz

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

laapsaap avatar Nov 01 '13 11:11 laapsaap

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/fdietz/team_dashboard/issues/112#issuecomment-27559746 .

fdietz avatar Nov 05 '13 08:11 fdietz

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 avatar Mar 19 '14 03:03 mikeforbes

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 :grin:

mikeforbes avatar Mar 19 '14 04:03 mikeforbes