Graphite Aggregation Rules for finding per-day metrics using per-hour metrics

pradeepchhetri picture pradeepchhetri · Oct 6, 2012 · Viewed 7.4k times · Source

I am facing problem regarding writing aggregation rules for plotting per-day metrics. I have two servers which are sending metric name as

production.email.server_1.total_emails_sent.1h.sum production.email.server_2.total_emails_sent.1h.sum

They are sending this metric once per hour. I am able to find the sum of these two metrics by adding an aggregation rule as follows:

production.email.all.1h.sum (3600) = sum production.email.*.1h.sum

Now I have to find the sum on per-day basis by using the same per-hour metric. I want a metrics named

production.email.server_1.total_emails_sent.1d.sum

which I can find by summing the metric production.email.server_1.total_emails_sent.1h.sum for the past 24 hours. How can I find out this metric?

Answer

rowanu picture rowanu · Jan 11, 2013

It sounds like you want the summarize function.

&target=summarize(production.email.server_1.total_emails_sent.1h.sum, "1day")

Check out the docs for summarize.

Depending on how that works out, you might even like to try the smartSummarize function...