Graphite Tips

Recent came up with a few things that make using graphite even easier. Namely the Graphlot view. It’s a much nicer view for single graphs then the composer as it lets you zoom in easily, and unlike rrd, you can zoom in both horizontally and vertically. Problem is it sucks for building graphs in it, and I’ve got lots of complicated graphs I want to look at. So I took a hint from the Graphite Composer bookmarklet at obfuscurity, and created a bookmarklet for graphlot. Just drag this link into your bookmarks bar. It will prompt for a graphite url, and then will take you to the graphlot page for it. Open In Graphlot

Additionally, there is a problem with graphlot in that it only displays times in UTC. This is a problem if you live anywhere else, and gets confusing when trying to correlate with events outside of graphite. So after digging through the graphlot code, which is mostly javascript/jquery stuff that is greek to me. I tracked down the time display piece and added a variable to set to the UTC offset in milliseconds, and subtract it from the dates before any of the processing is done.

Heres the diff

File: /opt/graphite/webapp/content/js/jquery.flot.js

30,32d29
< //Added UTC Offset to correct date, set to millisecond difference between local timezone and utc
<
< UTCOFFSET=25200000;
917,918c914
<             //Added UTCOFFSET to correct date
<             var d = new Date(v – UTCOFFSET);

>             var d = new Date(v);

Hopefully these make it a little easier and nicer to use.

 

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *