-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Lens] Time shift previous period #104259
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
as discussed today, we can use this issue to track bringing previous back to time shifts (since it's been removed). need to answer:
|
There is a small difference between time shift previous bucket and something like differences - time shift previous bucket does its own data fetching which means the very first bucket will also have a "previous" one of the data allows it (the bucket which is not in the overall time range anymore). If we want this, then I think we need a |
Thinking about it, I like the |
this issue #62381 shows why we need a "previous bucket" and the "overall previous" time period as distinct options |
scope this issue for only the "overall previous" or "previous range" concept and created #115776 to account for the bucket-style functionality |
I think it would be possible to add the |
## Summary Fixes #104259 This PR expands the support of the `previous` time shift for visualisations with a date histogram defined. On the implementation side, an absolute time shift in the shape of `endAt( startRange )` is leveraged to make it work the `previous` shift: anchoring the shift to the beginning of the current range will make sure to compute the right shift in terms of buckets in order to avoid misaligned shifts and the main reason why this feature has been disabled initially. I've tried to condense an explanation here with this diagram of the misalignment problem: ![previous_before](https://user-images.githubusercontent.com/924948/213234848-40e3382a-843d-43fa-83d1-769a5f2e7953.png) With the current approach, there's a small time range overlap between the two requested interval, but that's the result of the rounding logic to get both shifts aligned. ![previous_2](https://user-images.githubusercontent.com/924948/213235429-1c99aefb-e18b-450a-b2d7-45b7d74c9e71.png) The only alternative to avoid the overlap is to get a gap between the two, but the former seems a better result to me. ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) Co-authored-by: Stratoula Kalafateli <[email protected]>
Describe the feature:
Allow time shifts involving date histograms to be previous to the overall time period of the report:
If the date histogram is 30 second intervals and the report is "last 15 minutes" than "previous overall period" would be a 15 minute shift. Today "previous" time shifts when used on date histogram appears to shift back one previous date histogram interval (30 seconds in this case) which I don't believe is as useful given the user can see those values anyway (except one previous period on the end of the histogram)
Describe a specific use case for the feature:
Shifts involving data that's also visible on the range don't seem as useful as an indentical shift to the overall reporting period. So if I dynamically select "3 hours" it would be nice if there was an option that generated the 3 previous hours automatically.
I believe it works this way if you aren't using a date histogram (previous is the previous overall time period)
The text was updated successfully, but these errors were encountered: