Skip to content

fix(explore): Pass sort param for group-by explore Slack unfurls#112704

Merged
DominikB2014 merged 1 commit intomasterfrom
dominikbuszowiecki/dain-1490-incorrect-data-with-group-by
Apr 10, 2026
Merged

fix(explore): Pass sort param for group-by explore Slack unfurls#112704
DominikB2014 merged 1 commit intomasterfrom
dominikbuszowiecki/dain-1490-incorrect-data-with-group-by

Conversation

@DominikB2014
Copy link
Copy Markdown
Contributor

When an Explore link with groupBy is unfurled in Slack, the unfurl sets
topEvents=5 but omits the sort parameter. Without it, the timeseries
endpoint returns whichever groups it defaults to rather than the actual top
groups matching what Explore shows (e.g., "mark" and "paint" appearing
instead of the real top groups).

Two changes:

  • map_explore_query_args now copies the aggregateSort URL param
    (Explore's name) as sort (the API param name)
  • _unfurl_explore defaults to -{yAxis} (descending by the charted
    aggregate) when no explicit sort is present, matching the frontend's
    defaultAggregateSortBys behavior

Fixes DAIN-1490

@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 10, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 10, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 461b824. Configure here.

Comment thread src/sentry/integrations/slack/unfurl/explore.py Outdated
When an Explore link with groupBy is unfurled in Slack, the unfurl sets
topEvents=5 but omits the sort parameter. Without it, the timeseries
endpoint returns whichever groups it defaults to rather than the top
groups matching what Explore shows.

Now copies the aggregateSort URL param (Explore's name) as sort (the
API name), and defaults to descending by the charted yAxis when no
explicit sort is present — matching the frontend's behavior.

Fixes DAIN-1490
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DominikB2014 DominikB2014 force-pushed the dominikbuszowiecki/dain-1490-incorrect-data-with-group-by branch from 461b824 to 209d23c Compare April 10, 2026 18:27
@DominikB2014 DominikB2014 marked this pull request as ready for review April 10, 2026 18:35
@DominikB2014 DominikB2014 requested review from a team as code owners April 10, 2026 18:35
@DominikB2014 DominikB2014 enabled auto-merge (squash) April 10, 2026 18:38
@DominikB2014 DominikB2014 requested a review from a team April 10, 2026 18:42
@DominikB2014 DominikB2014 merged commit 6bd1582 into master Apr 10, 2026
56 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/dain-1490-incorrect-data-with-group-by branch April 10, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants