Skip to content

ref(flamegraph): Replace transactions dataset in profile candidates#112406

Merged
mjq merged 3 commits intomasterfrom
mjq/remove-transactions-dependency-from-flamegraph-endpoint-profiles-data-source
Apr 15, 2026
Merged

ref(flamegraph): Replace transactions dataset in profile candidates#112406
mjq merged 3 commits intomasterfrom
mjq/remove-transactions-dependency-from-flamegraph-endpoint-profiles-data-source

Conversation

@mjq
Copy link
Copy Markdown
Member

@mjq mjq commented Apr 7, 2026

Calling the flamegraph endpoint with data_source set to profiles still hits the transactions dataset when searching for matching profiles. Switch to query the Spans EAP dataset via the existing get_spans_based_candidates instead. (By adding is_transaction:true to the spans query, you'll get equivalent results as the previous transactions query).

This also removes the exponential chunking loop which was a workaround for querying the transactions dataset efficiently - with EAP we should be able to just make the query in one go (as we already do when data_source is spans).

Fixes DAIN-1463.

…didates

Switch get_profile_candidates_from_profiles to query the Spans EAP
dataset via get_spans_based_candidates instead of building a
DiscoverQueryBuilder against Dataset.Discover. Adds is_transaction:true
to the query to preserve equivalence with the previous transactions
dataset behavior. This removes the exponential chunking loop which was
a workaround for querying the transactions dataset efficiently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 7, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 7, 2026
@mjq mjq requested review from manessaraj and wmak April 7, 2026 20:44
@mjq mjq marked this pull request as ready for review April 7, 2026 20:54
@mjq mjq requested a review from a team as a code owner April 7, 2026 20:54
Comment thread src/sentry/profiles/flamegraph.py
Comment thread src/sentry/profiles/flamegraph.py
cursor[bot]

This comment was marked as resolved.

@mjq mjq marked this pull request as draft April 7, 2026 21:01
@mjq mjq marked this pull request as ready for review April 8, 2026 00:45
Comment thread src/sentry/profiles/flamegraph.py Outdated
cursor[bot]

This comment was marked as resolved.

@mjq mjq marked this pull request as draft April 8, 2026 01:13
@mjq mjq marked this pull request as ready for review April 8, 2026 14:02
Copy link
Copy Markdown
Member

@wmak wmak left a comment

Choose a reason for hiding this comment

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

LGTM, but as mentioned in slack would like to see verification that we can run this query without chunking before we merge this 👍

@mjq mjq merged commit 0f0768b into master Apr 15, 2026
55 checks passed
@mjq mjq deleted the mjq/remove-transactions-dependency-from-flamegraph-endpoint-profiles-data-source branch April 15, 2026 14:47
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