Altering the displayed timezone on a graph

Asked by Steffen Higel

Hi,

Our servers are all configured in UTC, as is our Graphite install, though we have 2 teams viewing and using the data from Graphite in timezones on either side of UTC.

I've looked through the source and couldn't find a way of altering the displayed timezone. It would save a small amount of mental arithmetic if we could add something like &tzoffset=-7 or &displaytz=PST. Is there some trivial way of doing this or will it require source changes (which I could probably do at some point in the next 2 weeks)?

thanks,

Steffen

Question information

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

This isn't currently supported but it would be a welcomed feature if you're up for implementing it. There are a few things to keep in mind if you attempt to tackle it though, first is simply putting in an offset in the timestamps used to draw the x-axis labels (search for "Draw the X-labels" in webapp/render/glyph.py). There is already some code there that adjusts the time to UTC for graphs whose pixel scale is in units of days or larger because otherwise each datapoint is off by a day. You could probably just add to this behavior based on a user-specified parameter.

The next issue is that you will need to add something to the UI to allow the user to specify their timezone.

Finally, I believe there will need to be a special case to handle when the user specifies an absolute date range instead of a relative time. The date range will be in the user's timezone and thus will need to be converted to the server's timezone before pulling in the datapoints, otherwise the wrong data will be displayed. For relative times though (ie. from=-2hours) this should not be an issue.

I hope that helps and if you are in fact interested in implementing this I'd be glad to help.

Thanks,
Chris

Revision history for this message
Steffen Higel (higels) said :
#2

Hi Chris,

Thanks for the pointers.

I'll hopefully have a few quiet evenings this week to get stuck into it.

Revision history for this message
Pierre Baillet (octplane) said :
#3

Hello,

Seeing this message > 2 years old, I wonder what's its actual status ?

On my test server, the datetime displayed in the Dashboard toolbar is correct with my configured timezone in local settings but graph of current data are shifted 7 hours back in time (it currently indicates 8AM when it's 3PM in my timezone).

Although this is not critical, I suspect this could become annoying for for incident analysis.

Cheers,

Revision history for this message
Nicholas Leskiw (nleskiw) said :
#4

Did you set the timezone in /opt/graphite/webapp/graphite/loca_settings.py?

Revision history for this message
Pierre Baillet (octplane) said :
#5

Haha. I must have missed something. It works now using the settings. Have a nice week end.

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

Yep there is also a 'tz' setting now that you can specify in the graphing request, the values it accepts are the same as the TIMEZONE setting in local_settings.py