feat(sdk): Migrate frontend to span streaming#116466
Draft
vgrozdanic wants to merge 2 commits into
Draft
Conversation
Switch from transaction-based trace lifecycle to span streaming, where spans are sent individually as they complete instead of being batched into a transaction at the end. - Add spanStreamingIntegration() to enable streamed span delivery - Replace beforeSendTransaction with beforeSendSpan + withStreamedSpan for route name normalization on pageload/navigation spans - Replace span description filtering with ignoreSpans SDK option - Migrate legacy profilesSampleRate to v2 profileSessionSampleRate - Upgrade @sentry/core, @sentry/react, @sentry/node, and @sentry/profiling-node from 10.41.0-beta.0 to 10.55.0 Note: addExtraMeasurements and addUIElementTag (transaction-level batch operations) cannot work per-span in streaming mode and are now unused from initializeSdk. They remain exported from performanceForSentry for any other consumers. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Contributor
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.59% |
Remove addExtraMeasurements, addUIElementTag, and their private helpers (addAssetMeasurements, addCustomMeasurements, addSlowAppInit) which are no longer called after the span streaming migration. These functions operated on TransactionEvent objects and cannot work per-span. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Lms24
reviewed
May 29, 2026
Comment on lines
-330
to
-338
| transaction.measurements[`${ASSET_MEASUREMENT_ALL}.encoded`] = { | ||
| value: allEncoded, | ||
| unit: 'byte', | ||
| }; | ||
| transaction.measurements[`${ASSET_MEASUREMENT_ALL}.transfer`] = { | ||
| value: allTransfered, | ||
| unit: 'byte', | ||
| }; | ||
| transaction.tags.hasAnyAssetTimings = hasAssetTimings; |
Member
There was a problem hiding this comment.
we don't have to delete this. We can set the measurements as attributes on the segment span so that they can be queryable via span metrics. wdyt?
| } | ||
| } | ||
|
|
||
| transaction.measurements = measurements; |
Member
There was a problem hiding this comment.
neither these. though I wonder why we do special stuff for ttfb. It's recorded by the SDK by default
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.
Switch from transaction-based trace lifecycle to span streaming, where spans are sent individually as they complete instead of being batched into a transaction at the end. This gives lower latency span delivery and per-span processing.
SDK changes (
initializeSdk.tsx):spanStreamingIntegration()as the first integration (beforebrowserTracingIntegration)beforeSendTransactionwithbeforeSendSpanwrapped inwithStreamedSpan()for normalizing pageload/navigation span names vianormalizeUrlignoreSpansSDK option (amplitude.com, pendo.io, reload.getsentry.net)addExtraMeasurementsandaddUIElementTag— these are transaction-level batch operations that examine all spans collectively and cannot work per-span in streaming mode. They remain exported fromperformanceForSentrybut are now unused frominitializeSdkProfiling migration (
commonInitialization.tsx,types/system.tsx):profilesSampleRatewith v2profileSessionSampleRatein dev mode override and Config type. The legacy option conflicts with v2 — if both are set, the SDK ignoresprofileSessionSampleRateSDK upgrade (
package.json):@sentry/core,@sentry/react,@sentry/node,@sentry/profiling-node:10.41.0-beta.0→10.55.0(span streaming requires>=10.53.1)