Adhere to user selected time range for CSV exports#255005
Adhere to user selected time range for CSV exports#255005eokoneyo merged 10 commits intoelastic:mainfrom
Conversation
7e38623 to
3277864
Compare
This comment was marked as outdated.
This comment was marked as outdated.
3277864 to
62a97b8
Compare
|
/ci |
df05c05 to
e0601c3
Compare
|
/ci |
|
Pinging @elastic/appex-sharedux (Team:SharedUX) |
|
Wow, I'm kinda surprised by this issue - has it not been reported before? I just tried with a non-ES|QL discover, just use a time range BEFORE current time (obviously), and you'll see the generated CSV seems to cover the same time duration, but anchored on NOW as the end. As such, it seems weird we'd even give folks the option to have a "relative" time here, we should just always pass the time range in. @tsullivan any thoughts? |
|
@jughosta could you please review this one? |
|
@elasticmachine merge upstream |
This comment was marked as outdated.
This comment was marked as outdated.
e0601c3 to
d491e8b
Compare
@pmuellr I tend to agree. My understanding is that the job params for CSV are created with an awareness of what the time picker is set to. If the time picker uses a relative range then a relative range should be put into job params. I recall some work to support this before, and that it had to be revisited a few time. I dug up a few commits that worked on this: I guess the problem is unique to ES|QL mode because there is no timepicker? cc @eokoneyo |
|
Some customers rely on a relative time range for POST URL. For the reporting we could make it absolute by default but users should still have a possibility to opt for a relative time range for POST URL. A related comment from the issue discussion #216605 (comment):
|
I agree this conclusion would be in line with how it should work, I suppose we'd need to change the messaging so users know the switch applies only to the POST URL, @florent-leborgne could you help suggest an improvement to the copy, we want to inform users that toggling the switch only applies to the POST URL, thanks. |
|
@elasticmachine merge upstream |
kowalczyk-krzysztof
left a comment
There was a problem hiding this comment.
The code changes are fine, approving to unblock. Make sure to align on the business logic.
cb3b80c to
506e087
Compare
jughosta
left a comment
There was a problem hiding this comment.
Data Discovery changes LGTM 👍
506e087 to
5fd32b4
Compare
💛 Build succeeded, but was flaky
Failed CI Steps
Test Failures
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
History
cc @eokoneyo |
|
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI Steps
Test Failures
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
cc @eokoneyo |
pmuellr
left a comment
There was a problem hiding this comment.
ResponseOps changes LGTM
|
Starting backport for target branches: 8.19, 9.2, 9.3, 9.4 https://github.com/elastic/kibana/actions/runs/25095322772 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## Summary Closes elastic#216605 This PR adds implementation such that when generating a CSV export within Kibana from the discover app the absolute time range for the current session is used, whilst for retain the currently behaviour for the generated POST URL, this ensures that the export the user gets correlates one to one with the exact content the user is currently viewing. ## Implementation A new property `absoluteTimeRange` is now being passed to the sharing data for the discover app, this property is then used whilst generating a CSV export within Kibana, POST URL retains it's normal behavior of having the value the user selected in the UI, see (elastic#255005 (comment)) for the rationale behind this decision. ### Visual There is no visual change to the user. <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] 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/src/platform/packages/shared/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 - [ ] 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 was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit dd1ca76) # Conflicts: # packages/kbn-optimizer/limits.yml # src/platform/packages/private/kbn-reporting/public/share/integrations/csv/csv_export_config.tsx # src/platform/plugins/shared/discover/moon.yml # src/platform/plugins/shared/discover/public/application/main/components/top_nav/app_menu_actions/get_share.tsx # src/platform/plugins/shared/discover/tsconfig.json # src/platform/plugins/shared/share/public/components/export_integrations/export_integrations.tsx # src/platform/plugins/shared/share/public/components/export_integrations/index.ts # src/platform/plugins/shared/share/public/services/share_menu_manager.tsx
|
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. |
…266277) # Backport This will backport the following commits from `main` to `9.4`: - [Adhere to user selected time range for CSV exports (#255005)](#255005) <!--- Backport version: 11.0.2 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Eyo O. Eyo","email":"7893459+eokoneyo@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-04-29T07:00:22Z","message":"Adhere to user selected time range for CSV exports (#255005)\n\n## Summary\n\nCloses #216605\n\nThis PR adds implementation such that when generating a CSV export\nwithin Kibana from the discover app the absolute time range for the\ncurrent session is used, whilst for retain the currently behaviour for\nthe generated POST URL, this ensures that the export the user gets\ncorrelates one to one with the exact content the user is currently\nviewing.\n\n## Implementation\n\nA new property `absoluteTimeRange` is now being passed to the sharing\ndata for the discover app, this property is then used whilst generating\na CSV export within Kibana, POST URL retains it's normal behavior of\nhaving the value the user selected in the UI, see\n(https://github.com/elastic/kibana/pull/255005#issuecomment-4084863736)\nfor the rationale behind this decision.\n\n### Visual\n\nThere is no visual change to the user.\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dd1ca76250164ccf9ccdce0b0738bd94667bb4e2","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:SharedUX","backport:all-open","v9.5.0"],"title":"Adhere to user selected time range for CSV exports","number":255005,"url":"https://github.com/elastic/kibana/pull/255005","mergeCommit":{"message":"Adhere to user selected time range for CSV exports (#255005)\n\n## Summary\n\nCloses #216605\n\nThis PR adds implementation such that when generating a CSV export\nwithin Kibana from the discover app the absolute time range for the\ncurrent session is used, whilst for retain the currently behaviour for\nthe generated POST URL, this ensures that the export the user gets\ncorrelates one to one with the exact content the user is currently\nviewing.\n\n## Implementation\n\nA new property `absoluteTimeRange` is now being passed to the sharing\ndata for the discover app, this property is then used whilst generating\na CSV export within Kibana, POST URL retains it's normal behavior of\nhaving the value the user selected in the UI, see\n(https://github.com/elastic/kibana/pull/255005#issuecomment-4084863736)\nfor the rationale behind this decision.\n\n### Visual\n\nThere is no visual change to the user.\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dd1ca76250164ccf9ccdce0b0738bd94667bb4e2"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/255005","number":255005,"mergeCommit":{"message":"Adhere to user selected time range for CSV exports (#255005)\n\n## Summary\n\nCloses #216605\n\nThis PR adds implementation such that when generating a CSV export\nwithin Kibana from the discover app the absolute time range for the\ncurrent session is used, whilst for retain the currently behaviour for\nthe generated POST URL, this ensures that the export the user gets\ncorrelates one to one with the exact content the user is currently\nviewing.\n\n## Implementation\n\nA new property `absoluteTimeRange` is now being passed to the sharing\ndata for the discover app, this property is then used whilst generating\na CSV export within Kibana, POST URL retains it's normal behavior of\nhaving the value the user selected in the UI, see\n(https://github.com/elastic/kibana/pull/255005#issuecomment-4084863736)\nfor the rationale behind this decision.\n\n### Visual\n\nThere is no visual change to the user.\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dd1ca76250164ccf9ccdce0b0738bd94667bb4e2"}}]}] BACKPORT-->
…266429) # Backport This will backport the following commits from `main` to `9.3`: - [Adhere to user selected time range for CSV exports (#255005)](#255005) <!--- Backport version: 11.0.2 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Eyo O. Eyo","email":"7893459+eokoneyo@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-04-29T07:00:22Z","message":"Adhere to user selected time range for CSV exports (#255005)\n\n## Summary\n\nCloses #216605\n\nThis PR adds implementation such that when generating a CSV export\nwithin Kibana from the discover app the absolute time range for the\ncurrent session is used, whilst for retain the currently behaviour for\nthe generated POST URL, this ensures that the export the user gets\ncorrelates one to one with the exact content the user is currently\nviewing.\n\n## Implementation\n\nA new property `absoluteTimeRange` is now being passed to the sharing\ndata for the discover app, this property is then used whilst generating\na CSV export within Kibana, POST URL retains it's normal behavior of\nhaving the value the user selected in the UI, see\n(https://github.com/elastic/kibana/pull/255005#issuecomment-4084863736)\nfor the rationale behind this decision.\n\n### Visual\n\nThere is no visual change to the user.\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dd1ca76250164ccf9ccdce0b0738bd94667bb4e2","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:SharedUX","backport:all-open","v9.5.0"],"title":"Adhere to user selected time range for CSV exports","number":255005,"url":"https://github.com/elastic/kibana/pull/255005","mergeCommit":{"message":"Adhere to user selected time range for CSV exports (#255005)\n\n## Summary\n\nCloses #216605\n\nThis PR adds implementation such that when generating a CSV export\nwithin Kibana from the discover app the absolute time range for the\ncurrent session is used, whilst for retain the currently behaviour for\nthe generated POST URL, this ensures that the export the user gets\ncorrelates one to one with the exact content the user is currently\nviewing.\n\n## Implementation\n\nA new property `absoluteTimeRange` is now being passed to the sharing\ndata for the discover app, this property is then used whilst generating\na CSV export within Kibana, POST URL retains it's normal behavior of\nhaving the value the user selected in the UI, see\n(https://github.com/elastic/kibana/pull/255005#issuecomment-4084863736)\nfor the rationale behind this decision.\n\n### Visual\n\nThere is no visual change to the user.\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dd1ca76250164ccf9ccdce0b0738bd94667bb4e2"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/255005","number":255005,"mergeCommit":{"message":"Adhere to user selected time range for CSV exports (#255005)\n\n## Summary\n\nCloses #216605\n\nThis PR adds implementation such that when generating a CSV export\nwithin Kibana from the discover app the absolute time range for the\ncurrent session is used, whilst for retain the currently behaviour for\nthe generated POST URL, this ensures that the export the user gets\ncorrelates one to one with the exact content the user is currently\nviewing.\n\n## Implementation\n\nA new property `absoluteTimeRange` is now being passed to the sharing\ndata for the discover app, this property is then used whilst generating\na CSV export within Kibana, POST URL retains it's normal behavior of\nhaving the value the user selected in the UI, see\n(https://github.com/elastic/kibana/pull/255005#issuecomment-4084863736)\nfor the rationale behind this decision.\n\n### Visual\n\nThere is no visual change to the user.\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dd1ca76250164ccf9ccdce0b0738bd94667bb4e2"}}]}] BACKPORT-->
Summary
Closes #216605
This PR adds implementation such that when generating a CSV export within Kibana from the discover app the absolute time range for the current session is used, whilst for retain the currently behaviour for the generated POST URL, this ensures that the export the user gets correlates one to one with the exact content the user is currently viewing.
Implementation
A new property
absoluteTimeRangeis now being passed to the sharing data for the discover app, this property is then used whilst generating a CSV export within Kibana, POST URL retains it's normal behavior of having the value the user selected in the UI, see (#255005 (comment)) for the rationale behind this decision.Visual
There is no visual change to the user.