Customizing Graphite Charts for Clearer Results

So if people couldn’t tell, I’ve been having a lot of success with StatsD, Graphite, and Graphene. One of the problems I faced was data that was too small to gather distinct trends. Here is one example:

While still useful, it is much harder to detect a small change with a chart like this. The jump between highs and lows is greater on this data. This normally occurs when you have smaller sets of data to look at. So we have two options (that I’ve discovered so far). The first is to summarize the data using the summarize function. If you are using graphite, and haven’t checked out their awesome list of functions, you really need to.

Summarize allows you to change the unit in which graphite displays data. Right now we’re showing things per second. But it might be more useful if we knew what was going on every 5 minutes. So lets say this was our url for our graphite graph:

What we want to do is apply the summary function to the example.posts target:, "5min")

And your browser will change the spaces and quotes to be url encoded:,%20%225min%22)

Now our graph will look something like this:

Notice the units on the y-axis has changed. Then, if we wanted to measure it per hour, we just change the url to use “1h” instead of “5min”:

Another useful to tool in reading is using a Moving Average. This will take so many units next to each other and average them. So if we say we want to get a moving average of 60 units (so 60 seconds), our url would look something like this:, 60)

We replace the space with “%20” to URL Encode the function:,%2060)

Our chart will looks something like this:

Notice the gap now at the beginning, that is because there isn’t 60 points of data to average until the 60th point. This will cause the graph actually shift forward a bit. I personal have found that the moving average is most useful after being compared to the original. So you can have two targets, one with the original, and one with the movingAverage function applied:,%2060)

2 thoughts on “Customizing Graphite Charts for Clearer Results

  1. Hi,
    If i want to keep the Y-axis value constant means it should not change after refresh(or after applying the rendering function) also so how i can do that?



  2. Awesome, just what I was looking for. Now I made one 24h overview dashboard with 1h aggregation and another 6h dashboard with 5 minute aggregation. Much better than what I had before. Thank you!


Leave a Reply


You are commenting using your account. Log Out /  Change )

Google photo


Twitter picture


Facebook photo


Connecting to %s


%d bloggers like this: