-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Monitoring] Ensure all charts use the configured timezone #45949
[Monitoring] Ensure all charts use the configured timezone #45949
Conversation
Pinging @elastic/stack-monitoring |
💚 Build Succeeded |
I cannot get this fix to work. No matter what time zone I set Kibana to, I see the same times shown in the X-axis on Stack Monitoring charts. Happy to Zoom to show you what I'm seeing if it helps. |
With this PR, no matter what time zone I set in Kibana Advanced Settings (browser, America/New_York, etc.), all monitoring charts always displayed times on the x-axis in UTC. For comparison, on |
8f606ba
to
4beac7d
Compare
Okay thanks for the time and feedback all! I went back to the drawing board and think we have a better solution. At a high level, we are fetching the data from ES in the same fashion as before, which is in UTC timestamps. Once we receive the data back, we are offsetting the UTC timestamps based on the This should work fine, but it's a significant change that might require messaging somehow. We might also need to give support a heads up in case issues/questions arise as a result from this. Let's start a conversation here about this and figure out our exact approach moving forward. I'm going to CC some parties that might have some thoughts, or historical reasons why this change hasn't been done in the past. |
I can't think of any reason why we wouldn't honor the setting. For a long time, Monitoring did not touch Kibana Advanced Settings though, so historically that's probably the reason. Just wanted to add one thing to the review: make sure shared links where the time picker is used for something other than |
💔 Build Failed |
@chrisronline | * |
| |
|1pm ..... 5pm .... 9pm| Now with a -4h timezone offset: | * |
| |
|1pm ..... 5pm .... 9pm| |
This is what I'm seeing with this PR:
I'm not sure what you're suggesting here. Are you suggesting this behavior isn't ideal? Maybe that in step 8, the x-axis window should remain unchanged and still show |
Exactly. This way we always maintain the from and to labels and it's 1:1 with the top right date-picker. I think only the values/data should shift left/right, and fall into their respective offset buckets instead of the timestamps changing. |
I'm looking at other parts of Kibana and I'm seeing the behavior I described in this comment, notably, visualize. I'm assuming other parts of Kibana also follow this behavior, but happy to see examples if you know any. Assuming this isn't deviating from the rest of Kibana, I think we should continue with how it works right now and we can open a ticket/discussion about possibly changing it and the implications that might have. WDYT? |
The behavior I'm trying to convey is actually very similar to Visualize and Discover. Notice how the chart's timespan labels are always in sync with the top-right time-range picker (no matter the timezone). So, the url should always contain the UTC while the time-range and chart x labels should both have the timezone's relative offset |
@igoristic Are you not seeing this behavior in the PR? I'm seeing it work the way you're describing. Can you maybe include screenshots of the monitoring UI with specifics about what you're seeing? |
@igoristic Solid catch! Fixed up now and ready for another round. |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working as expected. Great job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrisronline Functionality LGTM but I see there's a TODO in the PR description. Please let me know when you've resolved it and I'll re-review this PR. Thanks.
@ycombinator Thanks for the reminder. This is done in 20a9d16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
💔 Build Failed |
💚 Build Succeeded |
…5949) * Consistently apply dateFormat:tz to all monitoring time-series data * Ensure browser timezone works properly * Fix tests * Fix other test * Simplfy timezone fetching * Fix tests
…5949) * Consistently apply dateFormat:tz to all monitoring time-series data * Ensure browser timezone works properly * Fix tests * Fix other test * Simplfy timezone fetching * Fix tests
Resolves #29010
This PR ensures all monitoring charts respect the configured time zone.
TODO
Use a simpler way to fetch uiSettings ->await request.getUiSettingsService().get('dateFormat:tz')
Testing
dateFormat:tz
to something other thanBrowser