You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
INP metric: CSS selector generation is too shallow and produces highly ambiguous selectors #104128
The current CSS selector generator used for INP spans is too limited (function htmlTreeAsString):
it only walks ~5 parent levels up the DOM,
it stops once the selector exceeds ~80 characters.
In React Native Web, CSS class names are long, so the 80-character limit is often hit immediately. As a result, the generated selectors are extremely generic and can match 100–150 elements on the page, each performing different actions.
This makes it very difficult to understand which UI interaction actually contributed to the INP measurement.
Solution Brainstorm
Here is one potential solution that would allow for the addition of more meaningful information:
Increase the parent traversal depth (e.g., 15–30 levels).
During traversal, look for a data-sentry-label attribute on ancestors.
If found, prepend that label to the final selector, for example:
This would allow developers to annotate interactive elements with stable identifiers and significantly improve the precision and usefulness of INP spans.
Activity
linear commentedon Nov 28, 2025
ENG-5984
getsantry commentedon Nov 28, 2025
Assigning to @getsentry/support for routing ⏲️
getsantry commentedon Dec 1, 2025
Routing to @getsentry/product-owners-insights for triage ⏲️
dariusz-biela commentedon Dec 3, 2025
I've submitted a PR with the proposed solution: getsentry/sentry-javascript#18398
bcoe commentedon Dec 4, 2025
Hey @dariusz-biela looks like this is being discussed on the SDK repo 👍 , I think
sentry-javascriptis the right place for the discussion. If there are issues with @AbhiPrasad's suggestion of using https://docs.sentry.io/platforms/react-native/integrations/component-names/ we can open issues there.