Skip to content

feat(explore): Add logs export modal with row limit#112674

Draft
JoshuaKGoldberg wants to merge 22 commits intomasterfrom
joshuakgoldberg/feat/explore-logs-export-modal
Draft

feat(explore): Add logs export modal with row limit#112674
JoshuaKGoldberg wants to merge 22 commits intomasterfrom
joshuakgoldberg/feat/explore-logs-export-modal

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Apr 10, 2026

Previously, all logs data exports were done with a LogsExportButton -> ExploreExport component -> DataExport component, which used a useDataExport hook internal to its file. This PR adds a LogsExportSwitch button on top of that which can opt into a new LogsExportModalButton if a ourlogs-modal-export feature flag is enabled, or ?logsModalExport=true is in query params.

LogsExportModalButton takes in the same general data and, on click, renders a new LogsExportModal. That modal component calls to the newly exported useDataExport hook.

useDataExport is also now augmented to:

  • Download logs locally if we know we're below the 1k page size limit
  • Download a file directly if given it as fileName from the server

In other words, previously:

LogsExportButton -> ExploreExport -> DataExport -> useDataExport

Now:

                     -> LogsExportButton -> ExploreExport -> DataExport -
                   /                                                      \
LogsExportSwitch -                                                         -> useDataExport
                   \                                                      /
                     ---> LogsExportModalButton ---> LogsExportModal ----

I also extracted a downloadFromHref used in both the CSV and JSON paths.

This was used for LOGS-690. Fixes LOGS-692.

Add DataExportWithModal (global modal + scraps form) beside the existing logs export control. Extend useDataExport to send an optional top-level limit to the data-export API.

Co-Authored-By: Cursor <noreply@cursor.com>
Made-with: Cursor
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 10, 2026
@sentry
Copy link
Copy Markdown
Contributor

sentry bot commented Apr 14, 2026

Sentry Snapshot Testing

Name Added Removed Modified Renamed Unchanged Status
sentry-frontend
sentry-frontend
0 0 0 0 204 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 14, 2026

Comment thread static/app/components/core/form/scrapsForm.tsx
Comment thread static/app/components/dataExport.spec.tsx
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

Comment thread static/app/utils/queryClient.tsx Outdated
}: LogsExportModalProps) {
const payload = useMemo(
() => ({
queryType: ExportQueryType.EXPLORE,
Copy link
Copy Markdown
Member Author

@JoshuaKGoldberg JoshuaKGoldberg Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once #112953 is in & we've validated on prod, I'll switch this to rely on allColumns. Currently blocked on some errors in Snuba-land.

@JoshuaKGoldberg JoshuaKGoldberg removed the Scope: Backend Automatically applied to PRs that change backend components label Apr 15, 2026
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Todo] Telemetry: other parts of the flow have pre-existing logs; I'll need to add some corresponding ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant