What Grafana version and what operating system are you using?
Grafana v7.5.6 (5fdad5bfe4)
What are you trying to achieve?
I have time-series data from two sources: one is providing timestamps in apparently any time zone, the other one in UTC. If I keep the dashboard time selector to EST (local time), then there is a gap on the right of the UTC dashboard, but all fine for the regular dashboard.
If I change the dashboard time range to consider UTC time, this panel will correct itself (shift to the right), and the other panel stays the same. This allows me to correlate the data and solves the main problem, but I am confused why I cannot use browser time / EST in the same manner and have the data still correlated. Why does changing the dashboard time range shift one panel but not the other? (They are different data sources)
How are you trying to achieve it?
I tried to use the âtime shiftâ query options in the offset panel to no avail, it would move the visible window of data but it would still be âshiftedâ to the left
What did you expect to happen?
I hope that I can line up the graphs all the way to the right with any time zone.
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
If I use âlocalâ browser time (EST) in the dashboard time range, these are the last timestamps returned from both panels in the data inspector:
2021-08-24 14:29:00
2021-08-24 10:29:00 -- this is the offset graph
You can see they are off by the expected amount. If I change the dashboard time range to UTC, the last timestamps are now the same:
2021-08-24 14:37:00
2021-08-24 14:37:00 -- now they are both the same
@T_GrumpyEngineer thanks for sharing your suggestion. I think the MSSQL workaround you propose would work if the timestamps donât have an explicit timezone set. Otherwise, if the timezone is set correctly, Grafana generally handles them in a very sane way.
@zeepeeare can you share what datasource(s) youâre using? Is it a timeseries database (Influx, Prometheus, âŚ), or SQL?
Queries on timeseries databases always yield UTC-timestamped data. Grafana will convert this to the browser time (or whatever timezone is selected in the time picker), and assuming that the source data was timestamped correctly, what is shown should be correct.
SQL databases are a bit more nuanced. Mainly because the timestamp/datetime field can include a timezone - but it might not. If the field type does not include an explicit timezone, then all sorts of funky stuff can happen - and if I had to guess, I suspect that this is what you might be experiencing @zeepeeare. Off the top of my head, Iâm not actually sure how Grafana treats datetimes without a timezone (but may well assume itâs UTC). I would recommend always explicitly including a timezone with any timestamps - to make them ISO 8601 compatible - or storing them as numerical Unix epoch values (implicitly UTC).
I wasnât bashing Grafana, just Iâm just dealing with MSSQL in a job for last 11 months so havenât really have had time to change old data sources.