icingaweb2-module-grafana icon indicating copy to clipboard operation
icingaweb2-module-grafana copied to clipboard

Fix timezone in rendered images

Open dgoetz opened this issue 4 years ago • 5 comments

This pull request fixes the timezone in rendered images by adding the timezone set in Icinga Web 2 (or if unset browser settings) to the url. Without it the timezone of the data is taken resulting in a mix of dates shown. Seen this behaviour while setting up a satellite with its own webinterface in Singapore (timezone set everywhere to Asia/Singapore) and using a browser with German settings (timezone is Europe/Berlin).

CC: @pdorschner

dgoetz avatar Oct 23 '19 09:10 dgoetz

Normaly there is no need to set a TZ for a dashboard url. Are you using the docker renderer? IF yes you have to set a timezone also for the docker container.

Mikesch-mp avatar Oct 24 '19 19:10 Mikesch-mp

No, we ware using Grafana in the current version installed on the same system. In Grafana we get the correct (browser) timezone but in the rendered images in Icinga Web 2 we get the timezone based on the data (backend is Graphite 0.9.16 from EPEL).

dgoetz avatar Oct 25 '19 09:10 dgoetz

The renderer uses the timezone of the system it runs on, which is from my few correct. if you are in a different timezone with your workstation then the system, you should change you workstations timezone.

You are correct for rendered images should shown the timezone of the browser whenever possible, but you PR is a) only half of the needed and b) for iframe mode not needed, because iframe is not done by Grafana renderer. Grafana always uses local browser timezone or if set hard to UTC.

Mikesch-mp avatar Oct 25 '19 09:10 Mikesch-mp

Hello, I'm the original author of this PR and I try to fix it. But I need to know what is needed for point (a to make this PR to be accepted.

Best regards

pdorschner avatar Mar 12 '20 12:03 pdorschner

Please redo for 2.0.0 aftter its released

Mikesch-mp avatar Feb 23 '23 12:02 Mikesch-mp