icingaweb2-module-grafana
icingaweb2-module-grafana copied to clipboard
Fix timezone in rendered images
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
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.
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).
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.
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
Please redo for 2.0.0 aftter its released