Skip to content

feat(browser): Report the INP target and interaction type as attributes - #24573

Merged
logaretm merged 1 commit into
developfrom
awad/inp-target-and-interaction-type
Sep 22, 2026
Merged

logaretm merged 1 commit into
developfrom
awad/inp-target-and-interaction-type

Conversation

@logaretm

@logaretm logaretm commented Sep 21, 2026

Copy link
Copy Markdown
Member

The element and interaction type an INP was reported on only existed as the span's name and op, which always have a value and so mislabel an INP reported without an interaction as a click, fixed by reporting them as browser.web_vital.inp.target and browser.web_vital.inp.interaction_type, set only for what was actually observed.

I added unit tests for an unresolved element and for an INP without an entry, and the INP browser integration tests now expect both attributes.

Question for the review: should the "unknown" case be reported as <unknown> or as unknown without the brackets, or omit it entirely? I chose to omit it for now.

ref Conventions PR: getsentry/sentry-conventions#641

The element and the kind of interaction an INP was reported on only
existed as the span's name and op. Both always have a value, even for an
INP that web-vitals reports without an entry, which is named
"Interaction to next paint" and filed under `ui.interaction.click` to
stay within the interaction span family. Nothing reading the span can
tell that apart from a real click.

Report them as `browser.web_vital.inp.target` and
`browser.web_vital.inp.interaction_type`, set only for what was actually
observed. The keys are hardcoded until getsentry/sentry-conventions#641
is released.
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.07 kB - -
@sentry/browser - with treeshaking flags 27.34 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.24 kB - -
@sentry/browser (incl. Tracing) 50.6 kB +0.09% +41 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 50.62 kB +0.08% +40 B 🔺
@sentry/browser (incl. Tracing, Profiling) 53.62 kB +0.08% +40 B 🔺
@sentry/browser (incl. Tracing, Replay) 90.16 kB +0.05% +45 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.25 kB +0.06% +42 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 94.86 kB +0.05% +44 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 107.83 kB +0.05% +45 B 🔺
@sentry/browser (incl. Feedback) 46.6 kB - -
@sentry/browser (incl. sendFeedback) 34.13 kB - -
@sentry/browser (incl. FeedbackAsync) 39.25 kB - -
@sentry/browser (incl. Metrics) 30.08 kB - -
@sentry/browser (incl. Logs) 30.34 kB - -
@sentry/browser (incl. Metrics & Logs) 31 kB - -
@sentry/react 30.82 kB - -
@sentry/react (incl. Tracing) 52.92 kB +0.07% +36 B 🔺
@sentry/vue 36.33 kB - -
@sentry/vue (incl. Tracing) 52.91 kB +0.08% +42 B 🔺
@sentry/svelte 29.1 kB - -
CDN Bundle 30.77 kB - -
CDN Bundle (incl. Tracing) 51.13 kB +0.07% +32 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.02 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.11 kB +0.08% +38 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 73.71 kB - -
CDN Bundle (incl. Tracing, Replay) 88.67 kB +0.04% +34 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.59 kB +0.05% +37 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 94.72 kB +0.06% +50 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.75 kB +0.06% +49 B 🔺
CDN Bundle - uncompressed 91.07 kB - -
CDN Bundle (incl. Tracing) - uncompressed 152.63 kB +0.08% +112 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.64 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 158.59 kB +0.08% +112 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.05 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 272.21 kB +0.05% +112 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 278.14 kB +0.05% +112 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 285.91 kB +0.04% +112 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 291.84 kB +0.04% +112 B 🔺
@sentry/nextjs (client) 55.26 kB +0.07% +38 B 🔺
@sentry/sveltekit (client) 51.05 kB +0.08% +36 B 🔺
@sentry/core/server 39.93 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 133.37 kB +0.02% +19 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.15 kB - -
@sentry/node - without tracing 89.92 kB +0.03% +22 B 🔺
@sentry/node - without channel injection 112.16 kB +0.03% +23 B 🔺
@sentry/aws-serverless 98.19 kB +0.02% +18 B 🔺
@sentry/cloudflare (withSentry) - minified 204.67 kB - -
@sentry/cloudflare (withSentry) 509.34 kB - -

View base workflow run

@Lms24 Lms24 left a comment

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.

I think, omitting is fine (and we could revisit if we needed it)

@logaretm
logaretm marked this pull request as ready for review September 22, 2026 19:12
@logaretm
logaretm requested a review from a team as a code owner September 22, 2026 19:12
@logaretm
logaretm requested review from msonnb and mydea and removed request for a team September 22, 2026 19:12
@logaretm
logaretm merged commit 2bff2ea into develop Sep 22, 2026
235 checks passed
@logaretm
logaretm deleted the awad/inp-target-and-interaction-type branch September 22, 2026 19:12
Lms24 added a commit that referenced this pull request Sep 22, 2026
…ebase

Rebasing onto develop replayed this branch over "Report the INP target and
interaction type as attributes" (#24573). Both sides had added an attributes
block to `_sendInpSpan`, and the auto-merge kept both, leaving a duplicate
`const attributes` declaration and a duplicate `browser.web_vital.inp.target`
assignment. Git raised no conflict for either.

Keep that PR's attribute line and drop ours, with one change: it read the
selector off the span name, which no longer holds one here. Under span
streaming the name is the component name or the op's fallback, so the
attribute now reads `selector` directly. Omitting it for a missing entry or an
unresolved element is unchanged.

The same merge duplicated the attribute's key inside single object literals
across six test files, which is dead code in a JS object. Drop the second of
each pair, and drop our negative assertion for the entry-less case, which that
PR's own test covers more precisely.

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.

2 participants