-
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
[Discover/Reporting] Fix export that does not contain relative time filter #110459
[Discover/Reporting] Fix export that does not contain relative time filter #110459
Conversation
We should check with @ppisljar and @lukasolson, who might know this answer. Maybe we still have an opportunity to fix this bug in SearchSource's behavior - it just needs to keep track of the relative time that was given as input. That would mean not changing Reporting code, and making SearchSource more friendly to any sharing service that uses it. However, this is a really bad bug and users have been waiting a long time for a fix. If it's not feasible to work this out in SearchSource then the direction @jloleysens is going with this PR is acceptable to me. |
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.
We need to make sure that when we serialize searchsource we can restore it on the server and we shouldn't need to do any other tricks to make that work.
We shouldn't be doing any special handling in reporting. That gives reporting way too much internal knowledge of how searches are performed and it will quickly get us back to the csv export v1 days.
here is the issue describing our conversion to absolute: #88480 |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Pinging @elastic/kibana-app-services (Team:AppServices) |
Pinging @elastic/kibana-reporting-services (Team:Reporting Services) |
ML change LGTM 🎉 |
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
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 LGTM
…ilter (elastic#110459) * version 1 of fix: we set the time range on the search source at CSV generation time * updated jest tests and updated API for getSharingData * make time range optional for getSharingData * pivot to updating "getTime" functionality by introducing a new flag * update jest snapshots * update comment * refactored coerceToAbsoluteTime -> coerceRelativeTimeToAbsoluteTime and updated behaviour to be more specific * fix jest test * do not change createFilter API, rather create new createRelativeFilter API, also only use this in one place in discover * update jest tests * update mock * update jest test mock Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…ilter (elastic#110459) * version 1 of fix: we set the time range on the search source at CSV generation time * updated jest tests and updated API for getSharingData * make time range optional for getSharingData * pivot to updating "getTime" functionality by introducing a new flag * update jest snapshots * update comment * refactored coerceToAbsoluteTime -> coerceRelativeTimeToAbsoluteTime and updated behaviour to be more specific * fix jest test * do not change createFilter API, rather create new createRelativeFilter API, also only use this in one place in discover * update jest tests * update mock * update jest test mock Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/data/common/query/timefilter/get_time.test.ts
…ilter (elastic#110459) * version 1 of fix: we set the time range on the search source at CSV generation time * updated jest tests and updated API for getSharingData * make time range optional for getSharingData * pivot to updating "getTime" functionality by introducing a new flag * update jest snapshots * update comment * refactored coerceToAbsoluteTime -> coerceRelativeTimeToAbsoluteTime and updated behaviour to be more specific * fix jest test * do not change createFilter API, rather create new createRelativeFilter API, also only use this in one place in discover * update jest tests * update mock * update jest test mock Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/data/common/query/timefilter/get_time.test.ts # src/plugins/data/common/query/timefilter/get_time.ts
…ilter (#110459) (#112088) * version 1 of fix: we set the time range on the search source at CSV generation time * updated jest tests and updated API for getSharingData * make time range optional for getSharingData * pivot to updating "getTime" functionality by introducing a new flag * update jest snapshots * update comment * refactored coerceToAbsoluteTime -> coerceRelativeTimeToAbsoluteTime and updated behaviour to be more specific * fix jest test * do not change createFilter API, rather create new createRelativeFilter API, also only use this in one place in discover * update jest tests * update mock * update jest test mock Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…ilter (#110459) (#112089) * version 1 of fix: we set the time range on the search source at CSV generation time * updated jest tests and updated API for getSharingData * make time range optional for getSharingData * pivot to updating "getTime" functionality by introducing a new flag * update jest snapshots * update comment * refactored coerceToAbsoluteTime -> coerceRelativeTimeToAbsoluteTime and updated behaviour to be more specific * fix jest test * do not change createFilter API, rather create new createRelativeFilter API, also only use this in one place in discover * update jest tests * update mock * update jest test mock Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/data/common/query/timefilter/get_time.test.ts
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
2 similar comments
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
… time filter (#110459) (#112090) * [Discover/Reporting] Fix export that does not contain relative time filter (#110459) * version 1 of fix: we set the time range on the search source at CSV generation time * updated jest tests and updated API for getSharingData * make time range optional for getSharingData * pivot to updating "getTime" functionality by introducing a new flag * update jest snapshots * update comment * refactored coerceToAbsoluteTime -> coerceRelativeTimeToAbsoluteTime and updated behaviour to be more specific * fix jest test * do not change createFilter API, rather create new createRelativeFilter API, also only use this in one place in discover * update jest tests * update mock * update jest test mock Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/data/common/query/timefilter/get_time.test.ts # src/plugins/data/common/query/timefilter/get_time.ts * fix types and linting Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
💔 Build Failed
Failed CI Steps
Test FailuresKibana Pipeline / general / Chrome UI Functional Tests.test/functional/apps/visualize/_tag_cloud·ts.visualize app visualize ciGroup12 tag cloud chart should collapse the sidebarStandard Out
Stack Trace
Kibana Pipeline / general / Chrome UI Functional Tests.test/functional/apps/dashboard/full_screen_mode·ts.dashboard app using current data full screen mode available in view modeStandard Out
Stack Trace
Kibana Pipeline / general / Chrome UI Functional Tests.test/functional/apps/visualize/_data_table·ts.visualize app visualize ciGroup9 data table should allow applying changed paramsStandard Out
Stack Trace
and 21 more failures, only showing the first 3. Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
Closes #22261
This PR updates Discover and Reporting to work together in a way that allows for the use of relative time ranges to be set in reports.
The current implementation adds new functionality to the
get_time.ts
. A new functiongetRelativeTime
was added that will allow relative time values, likenow-1m
, to be unchanged in the generatedSearchSource
. ThegetTime
function is unchanged to prevent issues with other consumers that may rely on absolute time.How to test
kibana_sample_data_flights
)now
tonow-2m
. This is a fairly small window for testing purposes.kibana_sample_data_flights
by running:Share
menu request a new CSV reporttimeRange
value is present and that there are no absolute time values.Release note
We fixed an issue where the URL for generating discover reports only contained absolute time values despite users inputting a relative time value.
Checklist