-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Search] Search Sessions with relative time range #84405
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
Conversation
42fd29a to
a13e3ce
Compare
|
@elasticmachine merge upstream |
lukasolson
left a comment
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.
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.
i am wondering why is this not part of session service ? i would expect that when creating a session its 'fixed in time' by converting the relative time to absolute.
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.
It is not part of session service because it is also includes functionality the previously was part of time filter about getting now from the URL (so not only session can control "now"):
https://github.com/elastic/kibana/pull/84405/files/c92374a20f65fe24447bdef8c5b1dbf8c94dfeec#diff-fe41d6d47fbb6465cde6d519ae701f58b0259c89ecf3779048a49651a43b6276R29
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.
this moved from timefilter to this new nowProvider
Long term we should make apps responsible for getting this from the URL and setting it into nowProvider
|
Pinging @elastic/kibana-app-services (Team:AppServices) |
|
@elasticmachine merge upstream |
tsullivan
left a comment
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.
I'm not vastly familiar with the code that is changed in this PR. My takeaway is the motivation seems to add a new contract called NowProvider.
we already had some forceNow logic for reporting. So some conversions could be missed and I am happy to follow on that
I'm not sure what you mean by "conversions could be missed". [1]
Can you add more info about what NowProvider is and how an app should use it? Also talk about what conversions you worked on in this PR to help clarify my understanding about [1].
923baf9 to
05b927f
Compare
lizozom
left a comment
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.
Reviewed the code thoroughly and tested the things I could think.
LGTM.
…lative-timerange # Conflicts: # src/plugins/data/public/public.api.md # src/plugins/data/public/search/session/search_session_state.ts # src/plugins/data/public/search/session/session_service.test.ts
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.
Code review only: Presentation team changes LGTM. Can't wait to see these changes in by default!
| }) | ||
| ); | ||
| subscriptions.add( | ||
| data.query.timefilter.timefilter.getAutoRefreshFetch$().subscribe(() => { |
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.
Nit: We already have a shortcut const for timefilter declared above. It also might be a bit cleaner to merge the two subs that do the same thing:
subscriptions.add(
merge(data.search.session.onRefresh$, timeFilter.getAutoRefreshFetch$()).subscribe(() =>
setLastReloadTime(() => new Date().getTime())
)
);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.
Improved 👍
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
stratoula
left a comment
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.
Kibana app code review changes LGTM.
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
Part of #83640
In master background session restoration works only for absolute time ranges.
This pr attempts to make it work for relative time ranges, by "syncing" Date.now() between different searches when relative time range is converted into absolute time range.
Relative to absolute time conversion is not centralized even though we already had some
forceNowlogic for reporting. So some conversions could be missed and I am happy to follow on thatNowProvideris introduced in data services which keeps tracked of currentnowvalue. When session is startedsessionServicesets a newnowintoNowProviderso all subsequent searches using it for converting from relative to absolute time range:high-level diagram
In future instead of using
nowfor converting just time filter we would explore using point at time apiThere was an edge case with auto refresh. Previously new session wasn't created on auto refresh fetches and with new approach it would cause the same
nowfor all refreshes. Now new sessions are created on auto refresh fetches. For this autoRefresh subscription was moved on a dashboard level and removed from embeddable layer. #84405How to test
searchSessionIdfrom any of inspector. Get absolute time range from any of inspectors.${dashboardURL}&searchSessionId=${searchSessionId}and replace relative time range with copied time range^^ this is what functional test doest
Demo
I took this pr + #81707 to record this demo:
demo_720.mov
Use this branch to try it yourself: https://github.com/Dosant/kibana/tree/feature/data/management-ui-plus
Checklist
For maintainers