summarize, retentions & timezone

Asked by Yuri

I would like to know how can I set a timezone for functions like summarize and for retentions.

Let's start with retentions.
I have the following settings:
[daily]
priority = 100
pattern = ^stats\.aggregated\.daily\.
retentions = 86400:1825

So it 1 point per day data. I have realized that the retentions work in UTC timezone, so 1 day is meant a period of time from 00:00 UTC to 00:00 UTC next day. Is it possible to set a specific timezone here to have a "different" day edges for that timezone?

As for summarize function, it is also interesting what timezone is used when I do the following:
summarize(stats.some_counter, '1d') on 1 minute data (retentions = 60:*),
and how can I change it if possible. It seems that the timezone used in this case is not a UTC timezone and not a timezone from settings.py.

Question information

Language:
English Edit question
Status:
Answered
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
chrismd (chrismd) said :
#1

I believe this issue was fixed in Bug #712036 so if you're on 0.9.9 you should be able to fix this by using the extended form of summarize() like so:

summarize(stats.some_counter, "1d", "sum", "true")

The general form is:

summarize(series_expression, summary_interval, aggregation_func, align_to_from)

Having a 4th arg of "true" will align the summarization buckets to the begining of the request, which means you have to use absolute from/until parameters (formats include "HH:MM YYYYMMDD"), using relative (like "-30d") will cause confusing results, unless you make the request at midnight :)

Revision history for this message
chrismd (chrismd) said :
#2

Sorry forgot to answer the first part of your question. Regarding the storage no it is timezone-agnostic and just uses epoch times. The timezone only comes into play in the webapp, where it is configured by the TIME_ZONE setting in local_settings.py or via the 'tz' query string parameter. As long as the timezone settings are correct you should see correct time labels in your graphs.

Can you help with this problem?

Provide an answer of your own, or ask Yuri for more information if necessary.

To post a message you must log in.