-
-
Notifications
You must be signed in to change notification settings - Fork 5
feat(attributes): Add the INP target and interaction type attributes #641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
model/attributes/browser/browser__web_vital__inp__interaction_type.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "key": "browser.web_vital.inp.interaction_type", | ||
| "brief": "The kind of user interaction INP was reported on", | ||
| "type": "string", | ||
| "apply_scrubbing": { | ||
| "key": "manual" | ||
| }, | ||
| "is_in_otel": false, | ||
| "visibility": "public", | ||
| "examples": ["click", "hover", "drag", "press"], | ||
| "additional_context": [ | ||
| "One of `click`, `hover`, `drag` or `press`, derived from the DOM event name of the Event Timing entry: pointer, mouse and touch events map to `click`, `mouseover` and similar to `hover`, drag and drop events to `drag`, and keyboard and `input` events to `press`. The same value forms the suffix of the span's `ui.interaction.*` op.", | ||
| "Not to be confused with the `interactionType` of the web-vitals attribution build, which only distinguishes `pointer` and `keyboard`.", | ||
| "Omitted when INP is reported without an interaction to attribute it to, see `browser.web_vital.inp.target`. The op of such a span still falls into `ui.interaction.click` so that it stays within the interaction span family, which makes this attribute, not the op, the way to tell a real click from a value with no interaction." | ||
| ], | ||
| "changelog": [ | ||
| { | ||
| "version": "next", | ||
| "prs": [641], | ||
| "description": "Added browser.web_vital.inp.interaction_type attribute" | ||
| } | ||
| ] | ||
| } |
22 changes: 22 additions & 0 deletions
22
model/attributes/browser/browser__web_vital__inp__target.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "key": "browser.web_vital.inp.target", | ||
| "brief": "The HTML element selector or component name of the element the user interacted with, for the interaction INP was reported on", | ||
| "type": "string", | ||
| "apply_scrubbing": { | ||
| "key": "manual" | ||
| }, | ||
| "is_in_otel": false, | ||
| "visibility": "public", | ||
| "examples": ["body > div#app > button.submit", "SubmitButton"], | ||
| "additional_context": [ | ||
| "Named after `PerformanceEventTiming.target`, the way `browser.web_vital.lcp.element` is named after `LargestContentfulPaint.element`. The value uses the same format as that attribute.", | ||
| "Omitted when INP is reported without an interaction to attribute it to. web-vitals reports such a value for a soft navigation whose interactions all stayed below the Event Timing duration threshold, so there is no element to name. The span is still named and still carries `browser.web_vital.inp.value`." | ||
| ], | ||
| "changelog": [ | ||
| { | ||
| "version": "next", | ||
| "prs": [641], | ||
| "description": "Added browser.web_vital.inp.target attribute" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.elementattribute. Does it make sense to rename this tobrowser.web_vital.inp.element?Somewhat related, I'm planing on adding a
ui.element.selectorattribute 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.
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.targetmyselfUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
targetbecause that is what the API exposes, alsotargetSelectorin the future.It looks like this now, across all web vitals:
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.