Repository navigation
feat(attributes): Add the INP target and interaction type attributes - #641
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Other
Internal Changes 🔧Deps
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
9b57df4 to
0f51791
Compare
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.
0f51791 to
33c34d1
Compare
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]>
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]>
…#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.
…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
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`.
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`.
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`.
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`.
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`.
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.targetandbrowser.web_vital.inp.interaction_typeas attributes the SDK can send optionally when they are known.