Skip to content

feat(attributes): Add the INP target and interaction type attributes - #641

Merged
logaretm merged 3 commits into
mainfrom
awad/inp-element-and-interaction-type
Sep 22, 2026
Merged

logaretm merged 3 commits into
mainfrom
awad/inp-element-and-interaction-type

Conversation

@logaretm

@logaretm logaretm commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

The element and interaction type INP was reported on only exist in the span's name and op, I think it's a bit of a guess-work and is subject to breakage if we decide to rename span name/ops, an explicit attributes makes the most sense here.

I propose defining browser.web_vital.inp.target and browser.web_vital.inp.interaction_type as attributes the SDK can send optionally when they are known.

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Attributes

  • Add the INP target and interaction type attributes by logaretm in #641
  • Deprecate the web vital report event attributes by logaretm in #642
  • Add React Native native module call attributes by alwx in #564
  • Use the web-vitals navigation types as-is for browser.navigation.type by logaretm in #640
  • Add legacy gen_ai cache token attributes (deprecated) by JPeer264 in #582

Other

  • (op) Add ui.resolve span op by Lms24 in #633
  • (replays) Define replayId as a deprecated attribute by mjq in #401

Internal Changes 🔧

Deps

  • Bump devalue from 5.8.1 to 5.9.2 by dependabot in #639
  • Bump smol-toml from 1.6.1 to 1.8.0 by dependabot in #635

🤖 This preview updates automatically when you update the PR.

@logaretm logaretm changed the title feat(attributes): Add the INP element and interaction type attributes feat(attributes): Add the INP target and interaction type attributes Sep 21, 2026
@logaretm
logaretm marked this pull request as ready for review September 21, 2026 18:32
@logaretm
logaretm requested review from a team, Lms24, cleptric, mjq and nsdeschenes as code owners September 21, 2026 18:32

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.

Generally fine with this but to think about: We have a browser.web_vital.lcp.element attribute. Does it make sense to rename this to browser.web_vital.inp.element?

Somewhat related, I'm planing on adding a ui.element.selector attribute to generically capture selectors but this likely doesn't fit here, given the target could also be a component name. Does that make sense to you?

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.

actually, on second thought, "target" is probably more fitting for using it interchangeably on selectors or component names. I'll probably go with ui.element.target myself

@logaretm logaretm Sep 22, 2026 •

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.

I did some of research on which name to use, I should've added it to the PR 😓

So we seem to be following the names that the relevant APIs expose, so by doing the same we end up with target because that is what the API exposes, also targetSelector in the future.

It looks like this now, across all web vitals:

LCP  LargestContentfulPaint.element  ->  browser.web_vital.lcp.element
CLS  LayoutShift.sources             ->  browser.web_vital.cls.source.N
INP  PerformanceEventTiming.target   ->  browser.web_vital.inp.target

For ui.element.* namespace, it mostly belongs to the element timing API which follows the same pattern we outlined above. I don't want to muddy that IMO.

@logaretm
logaretm force-pushed the awad/inp-element-and-interaction-type branch from 9b57df4 to 0f51791 Compare September 22, 2026 14:43
The element and the kind of interaction INP was reported on only exist in
the span's name and op today. That makes them unavailable to anything
that reads attributes, and it cannot express an INP that web-vitals
reports without an interaction, which still gets a span name and a
`ui.interaction.click` op. Explicit attributes can simply be omitted then.
The web vital attributes are named after the field of the performance
entry they come from: `lcp.element` after `LargestContentfulPaint.element`,
`cls.source` after `LayoutShift.sources`. For INP that field is
`PerformanceEventTiming.target`, which is also what web-vitals and the
product call it.
@logaretm
logaretm force-pushed the awad/inp-element-and-interaction-type branch from 0f51791 to 33c34d1 Compare September 22, 2026 14:58
@logaretm
logaretm merged commit 10673c0 into main Sep 22, 2026
17 checks passed
@logaretm
logaretm deleted the awad/inp-element-and-interaction-type branch September 22, 2026 16:53
Lms24 added a commit that referenced this pull request Sep 22, 2026
Define name and description templates for the ui.* op family, and fill in
the op descriptions that were still missing in model/op.

Names stay low cardinality: component names for component ops, the route
for ui.action spans, and a literal fallback otherwise. Descriptions carry
the high cardinality element, taken from the vital-specific attribute for
each web vital - browser.web_vital.lcp.element for LCP,
browser.web_vital.cls.source.<key> for CLS, and browser.web_vital.inp.target
for the INP-measured ui.interaction.* ops.

Refs GH-641
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Lms24 added a commit that referenced this pull request Sep 22, 2026
Define name and description templates for the ui.* op family, and fill in
the op descriptions that were still missing in model/op.

Names stay low cardinality: component names for component ops, the route
for ui.action spans, and a literal fallback otherwise. Descriptions carry
the high cardinality element, taken from the vital-specific attribute for
each web vital - browser.web_vital.lcp.element for LCP,
browser.web_vital.cls.source.<key> for CLS, and browser.web_vital.inp.target
for the INP-measured ui.interaction.* ops.

Refs GH-641
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Lms24 added a commit that referenced this pull request Sep 22, 2026
…#643)

* feat(ui): Add span name and description conventions for ui.* ops

Define name and description templates for the ui.* op family, and fill in
the op descriptions that were still missing in model/op.

Names stay low cardinality: component names for component ops, the route
for ui.action spans, and a literal fallback otherwise. Descriptions carry
the high cardinality element, taken from the vital-specific attribute for
each web vital - browser.web_vital.lcp.element for LCP,
browser.web_vital.cls.source.<key> for CLS, and browser.web_vital.inp.target
for the INP-measured ui.interaction.* ops.

Refs GH-641
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Apply suggestion from @Lms24

* test: Let name and description templates reference a dynamic suffix variant

A template sometimes needs one concrete value of an attribute with a dynamic
suffix rather than the whole set, e.g. browser.web_vital.cls.source.1 for the
first layout shift source. Such a key has no attribute file of its own, so the
template validation reported it as undefined.

Fall back to the <key> form of the last segment and accept it when that
attribute declares has_dynamic_suffix, so a suffixed variant of an ordinary
attribute is still rejected. Extract the check, which name and description
duplicated verbatim, into a shared helper.
logaretm added a commit to getsentry/sentry-javascript that referenced this pull request Sep 22, 2026
…es (#24573)

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
logaretm added a commit to getsentry/relay that referenced this pull request Sep 22, 2026
The INP metric allowlisted a `browser.web_vital.inp.type` attribute that
no SDK ever sent. The attribute is now defined as
`browser.web_vital.inp.interaction_type` (getsentry/sentry-conventions#641)
and the browser SDK sends it next to `browser.web_vital.inp.target`.
logaretm added a commit to getsentry/relay that referenced this pull request Sep 23, 2026
The INP metric allowlisted a `browser.web_vital.inp.type` attribute that
no SDK ever sent. The attribute is now defined as
`browser.web_vital.inp.interaction_type` (getsentry/sentry-conventions#641)
and the browser SDK sends it next to `browser.web_vital.inp.target`.
logaretm added a commit to getsentry/relay that referenced this pull request Sep 23, 2026
The INP metric allowlisted a `browser.web_vital.inp.type` attribute that
no SDK ever sent. The attribute is now defined as
`browser.web_vital.inp.interaction_type` (getsentry/sentry-conventions#641)
and the browser SDK sends it next to `browser.web_vital.inp.target`.
logaretm added a commit to getsentry/relay that referenced this pull request Sep 23, 2026
The INP metric allowlisted a `browser.web_vital.inp.type` attribute that
no SDK ever sent. The attribute is now defined as
`browser.web_vital.inp.interaction_type` (getsentry/sentry-conventions#641)
and the browser SDK sends it next to `browser.web_vital.inp.target`.
logaretm added a commit to getsentry/relay that referenced this pull request Sep 23, 2026
The INP metric allowlisted a `browser.web_vital.inp.type` attribute that
no SDK ever sent. The attribute is now defined as
`browser.web_vital.inp.interaction_type` (getsentry/sentry-conventions#641)
and the browser SDK sends it next to `browser.web_vital.inp.target`.
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