Semantic conventions for browser events
Status: Development
This document defines semantic conventions for browser (web) instrumentations that emit events.
WebVital Event
Status:
The event name MUST be browser.web_vital.
This event describes the website performance metrics introduced by Google, See web vitals.
Attributes:
| Key | Stability | Requirement Level | Value Type | Description | Example Values |
|---|---|---|---|---|---|
browser.web_vital.delta | Required | double | The delta between the current value and the last-reported value. See delta. | 0.2 | |
browser.web_vital.id | Required | string | A unique ID representing this particular metric instance. | v3-1677874579383-6381583661209 | |
browser.web_vital.name | Required | string | Name of the web vital. | cls | |
browser.web_vital.value | Required | double | Value of the web vital. | 1.0 | |
browser.web_vital.navigation_type | Recommended | string | The type of navigation, as reported by the Navigation Timing API, with additional values reported by the web-vitals library. | navigate | |
browser.web_vital.rating | Recommended | string | The rating of the web vital value against the “good”, “needs improvement”, and “poor” thresholds defined for the metric. | good |
browser.web_vital.name has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
cls | Cumulative Layout Shift. See cls. | |
fcp | First Contentful Paint. See fcp. | |
inp | Interaction to Next Paint. See inp. | |
lcp | Largest Contentful Paint. See lcp. | |
ttfb | Time to First Byte. See ttfb. |
browser.web_vital.navigation_type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
back-forward | Navigation through the browser’s history traversal (e.g. back/forward buttons). | |
back-forward-cache | Navigation restoring a page from the back/forward cache (bfcache). | |
navigate | Navigation started by clicking a link, entering a URL, form submission, or a script operation. | |
prerender | Navigation to a page that was prerendered. | |
reload | Navigation through a reload operation or a Location.reload() call. | |
restore | Navigation restoring a page that was previously discarded by the browser. |
browser.web_vital.rating has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
good | The metric value is within the “good” threshold. | |
needs-improvement | The metric value is within the “needs improvement” threshold. | |
poor | The metric value is within the “poor” threshold. |
Feedback
Was this page helpful?
Thank you. Your feedback is appreciated!
Please let us know how we can improve this page. Your feedback is appreciated!