Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Fix the time range display issue(timezone) on visual report #240

Merged

Conversation

zhongnansu
Copy link
Member

Issue #, if available:

We recently decided to add the time range to the visual report(PDF/PNG), that introduced one issue. The time range always displays as UTC time. Because puppeteer launches the chromium from server side, so by default it’s using UTC. Ideally it should be user’s local timezone

Description of changes:

  • Add timezone as a query parameter for all APIs that returns actual report binary. Grab the timezone from browser (client side)
  • add env var to puppeteer launch browser process, which is visible to Chromium. So we can simulate a user accessing a dashboard from his timezone and rely on the default Kibana UI setting to use the browser timezone for time range display.

Notes

I also tried other solutions

  1. provide time string with offset in the query_url, but Kibana fails to recognize that. It seems it only accepts zulu time.
  2. Add an extra timezone field. We are not going with this solution due to the concern of backward compatibility. The accepted solution doesn't introduce any change to the schema

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@zhongnansu zhongnansu marked this pull request as ready for review December 3, 2020 19:54
Copy link
Contributor

@davidcui1225 davidcui1225 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhongnansu zhongnansu merged commit eb45de9 into opendistro-for-elasticsearch:dev Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants