Skip to content

feat(browser)!: Extract interaction spans into new interactionsIntegration - #23295

Merged
msonnb merged 9 commits into
developfrom
ms/interactions-integration
Aug 24, 2026
Merged

feat(browser)!: Extract interaction spans into new interactionsIntegration#23295
msonnb merged 9 commits into
developfrom
ms/interactions-integration

Conversation

@msonnb

@msonnb msonnb commented Aug 11, 2026

Copy link
Copy Markdown
Member

What

This extracts interaction spans into a new opt-in (standalone) interactionsIntegration.

// before
Sentry.browserTracingIntegration({ _experiments: { enableInteractions: true } });

// after
[Sentry.browserTracingIntegration(), Sentry.interactionsIntegration()];

Why

Interaction idle spans have been experimental since v7. We don't expect to promote them to stable, but they still cost bundle size for every user of browserTracingIntegration.

closes #22353

@msonnb

msonnb commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

bugbot run

Comment thread packages/browser-utils/src/performance/interactions.ts
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 30.3 kB - -
@sentry/browser - with treeshaking flags 28.47 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.81 kB - -
@sentry/browser (incl. Tracing) 48.33 kB -0.61% -296 B 🔽
@sentry/browser (incl. Tracing + Span Streaming) 48.34 kB -0.62% -300 B 🔽
@sentry/browser (incl. Tracing, Profiling) 51.25 kB -0.51% -258 B 🔽
@sentry/browser (incl. Tracing, Replay) 87.74 kB -0.33% -282 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.2 kB -0.29% -224 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 92.43 kB -0.33% -304 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 105.14 kB -0.28% -292 B 🔽
@sentry/browser (incl. Feedback) 47.65 kB - -
@sentry/browser (incl. sendFeedback) 35.13 kB - -
@sentry/browser (incl. FeedbackAsync) 40.28 kB +0.02% +6 B 🔺
@sentry/browser (incl. Metrics) 31.24 kB - -
@sentry/browser (incl. Logs) 31.52 kB - -
@sentry/browser (incl. Metrics & Logs) 32.15 kB - -
@sentry/react 32.09 kB - -
@sentry/react (incl. Tracing) 50.51 kB -0.63% -318 B 🔽
@sentry/vue 35.34 kB - -
@sentry/vue (incl. Tracing) 50.33 kB -0.55% -276 B 🔽
@sentry/svelte 30.33 kB - -
CDN Bundle 31.61 kB +0.03% +8 B 🔺
CDN Bundle (incl. Tracing) 48.81 kB -0.31% -147 B 🔽
CDN Bundle (incl. Logs, Metrics) 33.81 kB +0.03% +7 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 50.73 kB -0.29% -147 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 74.31 kB +0.01% +6 B 🔺
CDN Bundle (incl. Tracing, Replay) 86.31 kB -0.26% -219 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.16 kB -0.25% -220 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 92.03 kB -0.23% -204 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.97 kB -0.24% -219 B 🔽
CDN Bundle - uncompressed 93.86 kB +0.03% +20 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 146.04 kB -0.56% -811 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.16 kB +0.02% +20 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 151.73 kB -0.54% -811 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.1 kB +0.01% +20 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.31 kB -0.31% -800 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 270.99 kB -0.3% -800 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.01 kB -0.29% -800 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 284.67 kB -0.29% -800 B 🔽
@sentry/nextjs (client) 53.05 kB -0.55% -291 B 🔽
@sentry/sveltekit (client) 48.76 kB -0.59% -288 B 🔽
@sentry/core/server 65.83 kB - -
@sentry/core/browser 52.03 kB - -
@sentry/node 117.47 kB +0.03% +25 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.18 kB - -
@sentry/node - without tracing 82.02 kB +0.04% +25 B 🔺
@sentry/aws-serverless 91.44 kB +0.03% +20 B 🔺
@sentry/cloudflare (withSentry) - minified 194.61 kB - -
@sentry/cloudflare (withSentry) 481.16 kB - -

View base workflow run

@msonnb
msonnb force-pushed the ms/interactions-integration branch from fb1b1ca to f64077e Compare August 12, 2026 08:16
@msonnb
msonnb marked this pull request as ready for review August 12, 2026 08:20
@msonnb
msonnb requested a review from a team as a code owner August 12, 2026 08:20
@msonnb
msonnb requested review from Lms24 and logaretm and removed request for a team August 12, 2026 08:20
Comment thread packages/browser-utils/src/performance/interactions.ts
Comment thread packages/browser-utils/test/performance/interactions.test.ts
@github-actions

Copy link
Copy Markdown
Contributor

👋 @logaretm, @Lms24 — Please review this PR when you get a chance!

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

👋 @logaretm, @Lms24 — Please review this PR when you get a chance!

@msonnb
msonnb force-pushed the ms/interactions-integration branch from 718ec12 to b695d9d Compare August 24, 2026 07:30
@andreiborza
andreiborza self-requested a review August 24, 2026 08:52
msonnb and others added 4 commits August 24, 2026 13:11
…ration`

Interaction spans (`ui.action.click` idle spans and `ui.interaction.click`
event-timing spans) are no longer part of `browserTracingIntegration`. They move
into a standalone, opt-in `interactionsIntegration`.

The experimental `_experiments.enableInteractions` option is removed. As it was
the only experimental option, `browserTracingIntegration` no longer accepts an
`_experiments` object at all. The `idleTimeout`, `finalTimeout` and
`childSpanTimeout` options for interaction spans are configured on the new
integration instead of being inherited, using the same defaults.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@msonnb
msonnb force-pushed the ms/interactions-integration branch from b695d9d to 9b4b744 Compare August 24, 2026 11:13
Comment thread packages/browser/src/integrations/interactions.ts
Sentry.init({
traceLifecycle: 'static',
dsn: 'https://public@dsn.ingest.sentry.io/1337',
integrations: [Sentry.browserTracingIntegration({ enableLongTask: false })],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q: why did we add this option?

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.

was a leftover from before. removed.

Comment on lines +99 to +101
* Captures user interactions as spans.
*
* Clicks that happen outside of an in-progress pageload or navigation start an idle `ui.action.click` span,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* Captures user interactions as spans.
*
* Clicks that happen outside of an in-progress pageload or navigation start an idle `ui.action.click` span,
* Captures user interactions as spans.
*
* Important: This integration is considered experimental and might lead to noisy spans. Use at your own risk.
*
*
* Clicks that happen outside of an in-progress pageload or navigation start an idle `ui.action.click` span,

function trackRoute(span: Span): void {
const { name, attributes } = spanToJSON(span);
latestRoute.name = name;
latestRoute.source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] as TransactionSource | undefined;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should read both source attributes (from conventions) for now but #23368 will likely make SENTRY_SOURCE obsolete in a bit.

Suggested change
latestRoute.source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] as TransactionSource | undefined;
latestRoute.source = (attributes[SENTRY_SOURCE] || attributes[SENTRY_SEGMENT_NAME_SOURCE]) as TransactionSource | undefined;

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 317c345. Configure here.

Comment thread packages/browser-utils/src/performance/interactions.ts
Comment thread packages/browser-utils/src/performance/interactions.ts
@msonnb
msonnb merged commit a7a5265 into develop Aug 24, 2026
528 of 534 checks passed
@msonnb
msonnb deleted the ms/interactions-integration branch August 24, 2026 13:43
JPeer264 pushed a commit that referenced this pull request Aug 25, 2026
…ration` (#23295)

## What
This extracts interaction spans into a new opt-in (standalone)
`interactionsIntegration`.

```js
// before
Sentry.browserTracingIntegration({ _experiments: { enableInteractions: true } });

// after
[Sentry.browserTracingIntegration(), Sentry.interactionsIntegration()];
```
## Why

Interaction idle spans have been experimental since v7. We don't expect
to promote them to stable, but they still cost bundle size for every
user of `browserTracingIntegration`.

closes #22353

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move experimental interaction spans to dedicated integration

3 participants