ref(performance): Get transaction replay count with EAP#113359
Draft
ref(performance): Get transaction replay count with EAP#113359
Conversation
mjq
commented
Apr 17, 2026
Comment on lines
+10
to
+12
| if (count === undefined) { | ||
| return null; | ||
| } |
Member
Author
There was a problem hiding this comment.
This fixes DAIN-1456, by no longer rendering an empty grey background during loading.
Migrate useReplayCountForTransactions off the legacy /replay-count/ endpoint and onto the spans/EAP dataset via useSpans, matching where the rest of insights is moving. The hook only has one caller (transaction summary header) and only ever asked for a single transaction at a time, so the four-function indirection (getReplayCountForTransaction, getReplayCountForTransactions, transactionHasReplay, transactionsHaveReplay) is dropped in favor of a hook that returns the count directly for the transaction it's called with. Rather than a count_unique(replay.id) aggregate that scans the full 90d window, query up to 51 rows grouped by replay.id and count them client-side. ReplayCountBadge already caps display at "50+", so 51 rows is enough to distinguish "50+" from any exact count <= 50 — and it lets EAP short-circuit the scan. Override statsPeriod inline via the useSpans pageFilters option so the 90d window the replay tab wants doesn't get overridden by the page's global time filter. While the hook is loading, return undefined and have ReplayCountBadge render nothing so the empty grey pill doesn't flash before the count arrives.
2efe26e to
fbe30cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate
useReplayCountForTransactionsoff the legacytransactionsdataset (via/replay-count/endpoint) and onto the spans/EAP dataset viauseSpans, matching where the rest of insights is moving.The hook only has one caller (transaction summary header) and only ever asked for a single transaction at a time, so the four-function indirection (
getReplayCountForTransaction,getReplayCountForTransactions,transactionHasReplay,transactionsHaveReplay) is dropped in favour of a hook that returns the count directly for the transaction it's called with.I'm guessing that querying
limit + 1rows instead of acount_uniqueon replay IDs is faster since we can return results as soon as the limit is reached, but thecount()we're doing to dedupe might defeat that. Nonetheless, the query appears faster on Sentry than it used to be (in local testing).Fixes DAIN-1471.
Also fixes DAIN-1456.