-
Notifications
You must be signed in to change notification settings - Fork 211
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
Add Browser navigation timing event #1919
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!--- Hugo front matter used to generate the website version of this page: | ||
linkTitle: Events | ||
---> | ||
|
||
# Semantic conventions for Browser events | ||
|
||
**Status**: [Development][DocumentStatus] | ||
|
||
This document defines semantic conventions for browser (web) instrumentations | ||
that emit events. | ||
|
||
## Navigation Timing Event | ||
|
||
<!-- semconv event.browser.navigation_timing --> | ||
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. --> | ||
<!-- see templates/registry/markdown/snippet.md.j2 --> | ||
<!-- prettier-ignore-start --> | ||
<!-- markdownlint-capture --> | ||
<!-- markdownlint-disable --> | ||
|
||
**Status:**  | ||
|
||
The event name MUST be `browser.navigation_timing`. | ||
|
||
This event describes the timing metrics of a page navigation as provided by the PerformanceNavigationTiming Performance API. | ||
|
||
This event captures data from the [Navigation Timing API](https://www.w3.org/TR/navigation-timing-2/). It is recommended to be captured by using the PerformanceObserver API, or when the window load event fires. If the page starts unloading before the page loads, then the partial data can be captured by calling the [performance.getEntriesByType][https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByType] method. | ||
This event definition elevates a few key data points to body fields in order to make it easier to access. In addition, the complete set of data from the API may be sent in the body of the event as stringified JSON. | ||
|
||
**Body fields:** | ||
|
||
| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | ||
|---|---|---|---|---|---| | ||
| `domComplete` | double | The time immediately before the user agent sets the document's readyState to "complete". The value is relative to the start of the navigation, and it is measured in milliseconds. | `506.5` | `Recommended` |  | | ||
| `domContentLoadedEventEnd` | double | The time immediately after the current document's DOMContentLoaded event handler completes. The value is relative to the start of the navigation, and it is measured in milliseconds. | `189.0` | `Recommended` |  | | ||
| `domInteractive` | double | the time immediately before the user agent sets the document's readyState to "interactive". The value is relative to the start of the navigation, and it is measured in milliseconds. | `147.70000000018626` | `Recommended` |  | | ||
| `fetchStart` | double | The time immediately before the browser starts to fetch the resource. The value is relative to the start of the navigation, and it is measured in milliseconds. | `9.600000000558794` | `Recommended` |  | | ||
| `loadEventEnd` | double | The time immediately after the current document's load event handler completes. The value is relative to the start of the navigation, and it is measured in milliseconds. | `506.70000000018626` | `Recommended` |  | | ||
| `name` | string | The resolved URL of the requested resource. | `https://en.wikipedia.org/wiki/Main_Page` | `Recommended` |  | | ||
| `unloadEventStart` | double | The time immediately before the current document's unload event handler starts. The value is relative to the start of the navigation, and it is measured in milliseconds. | `0.0` | `Recommended` |  | | ||
|
||
<!-- markdownlint-restore --> | ||
<!-- prettier-ignore-end --> | ||
<!-- END AUTOGENERATED TEXT --> | ||
<!-- endsemconv --> | ||
|
||
[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
groups: | ||
- id: event.browser.navigation_timing | ||
stability: development | ||
type: event | ||
name: browser.navigation_timing | ||
brief: > | ||
This event describes the timing metrics of a page navigation as provided | ||
by the PerformanceNavigationTiming Performance API. | ||
note: > | ||
This event captures data from the [Navigation Timing API](https://www.w3.org/TR/navigation-timing-2/). | ||
It is recommended to be captured by using the PerformanceObserver API, or | ||
when the window load event fires. If the page starts unloading before | ||
the page loads, then the partial data can be captured by calling the | ||
[performance.getEntriesByType][https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByType] | ||
method. | ||
|
||
This event definition elevates a few key data points to body fields in | ||
order to make it easier to access. In addition, the complete set of data | ||
from the API may be sent in the body of the event as stringified JSON. | ||
body: | ||
id: browser.navigation_timing | ||
requirement_level: required | ||
stability: development | ||
type: map | ||
fields: | ||
- id: name | ||
Check failure on line 26 in model/browser/events.yaml
|
||
type: string | ||
stability: development | ||
brief: The resolved URL of the requested resource. | ||
Check failure on line 29 in model/browser/events.yaml
|
||
requirement_level: recommended | ||
examples: ["https://en.wikipedia.org/wiki/Main_Page"] | ||
- id: fetchStart | ||
type: double | ||
stability: development | ||
brief: > | ||
The time immediately before the browser starts to fetch the | ||
resource. The value is relative to the start of the navigation, and | ||
it is measured in milliseconds. | ||
requirement_level: recommended | ||
examples: [9.600000000558794] | ||
- id: unloadEventStart | ||
type: double | ||
stability: development | ||
brief: > | ||
The time immediately before the current document's unload event | ||
handler starts. The value is relative to the start of the | ||
navigation, and it is measured in milliseconds. | ||
requirement_level: recommended | ||
examples: [0.0] | ||
- id: domInteractive | ||
type: double | ||
stability: development | ||
brief: > | ||
the time immediately before the user agent sets the document's | ||
readyState to "interactive". The value is relative to the start of | ||
the navigation, and it is measured in milliseconds. | ||
requirement_level: recommended | ||
examples: [147.70000000018626] | ||
- id: domContentLoadedEventEnd | ||
type: double | ||
stability: development | ||
brief: > | ||
The time immediately after the current document's DOMContentLoaded | ||
event handler completes. The value is relative to the start of the | ||
navigation, and it is measured in milliseconds. | ||
requirement_level: recommended | ||
examples: [189.0] | ||
- id: domComplete | ||
type: double | ||
stability: development | ||
brief: > | ||
The time immediately before the user agent sets the document's | ||
readyState to "complete". The value is relative to the start of the | ||
navigation, and it is measured in milliseconds. | ||
Comment on lines
+71
to
+74
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest moving the second sentence to the and maybe add links to the properties in each case, to be super explicit that these are defined externally, e.g. https://www.w3.org/TR/navigation-timing-2/#dom-performancenavigationtiming-domcomplete |
||
requirement_level: recommended | ||
examples: [506.5] | ||
- id: loadEventEnd | ||
type: double | ||
stability: development | ||
brief: > | ||
The time immediately after the current document's load event handler | ||
completes. The value is relative to the start of the navigation, and | ||
it is measured in milliseconds. | ||
requirement_level: recommended | ||
examples: [506.70000000018626] |
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.