Timezone and date range inconsistencies when scheduling database reports associated with Grafana dashboards.

Description

When scheduling database reports associated with Grafana dashboards, there are two date related elements to configure:

a) The time based on the cron-like setting when the report runs
b) The actual "relative" report range you choose in the UI.

When rendering the reports, that leads to inconsistencies between the time range on the X-Axis of the graphs rendered by Grafana and the time range displayed at the top of the report.

Here is what I did to reproduce it:

1) Configure a VM with OpenNMS 27.0.2, Grafana 7.3.4, and Helm 6.0.0. I installed the Image Renderer plugin version 2.0, with the required dependencies to have it working; something mandatory in Grafana 7 that wasn't required in Graffana 6 (which is why I didn't use Docker because of https://opennms.atlassian.net/browse/HELM-265#icft=HELM-265).

2) Set the VM's timezone to be America/Chicago (CST, to match what the customer has).

3) Create a Dashboard with "browser" as its timezone (the default) in Grafana.

4) Create a schedule for that dashboard. See screenshots.

I'm trying to choose the last 24 hours with what looks like a relative time range.

Note that on the second screenshot, the cron-like expression is based on the server's timezone (i.e., CST), not the user's timezone (America/New_York in my case) is also confusing.

5) Wait for the PDF to be generated, and I get the attached PDF.

See the difference between the X-Axis and the time rage, which suggests something different.

The above leads to confusion as, unlike the ad-hoc report (i.e., a report generated without a scheduler), it is not clear how the date range will be used.

Acceptance / Success Criteria

None

Attachments

3
  • 04 Jan 2021, 06:18 PM
  • 04 Jan 2021, 06:18 PM
  • 04 Jan 2021, 06:18 PM

Lucidchart Diagrams

Activity

Benjamin Reed February 2, 2021 at 4:20 PM

Fixed in foundation-2020

Benjamin Reed January 21, 2021 at 7:43 PM

Alejandro Galue January 4, 2021 at 6:51 PM

I enabled DEBUG for the renderer in grafana.ini, and here is what I got when I generated the attached report.

t=2021-01-04T11:55:00-0600 lvl=info msg=Rendering logger=rendering renderer=plugin path="d-solo/RzDQeD-Mk/sample-dashboard?panelId=2&from=1609632000000&to=1609718400000&width=1149&height=1572&timeout=30&theme=light&tz=UTC%2B00%3A00" t=2021-01-04T11:55:00-0600 lvl=dbug msg="Calling renderer plugin" logger=rendering renderer=plugin req="url:\"http://localhost:3000/d-solo/RzDQeD-Mk/sample-dashboard?panelId=2&from=1609632000000&to=1609718400000&width=1149&height=1572&timeout=30&theme=light&tz=UTC%2B00%3A00&render=1\" width:1149 height:1572 deviceScaleFactor:1 filePath:\"/var/lib/grafana/png/Lqm4GISoDsoyVxs39AMl.png\" renderKey:\"rOthbwVqNXA3Lkvv79B4H6jxF7EWM8o4\" domain:\"localhost\" timeout:30 timezone:\"UTC-00:00\" "
Fixed

Details

Assignee

Reporter

HB Backlog Status

FD#

Sprint

Affects versions

Priority

PagerDuty

Created January 4, 2021 at 6:19 PM
Updated February 2, 2021 at 10:19 PM
Resolved February 2, 2021 at 4:20 PM

Flag notifications