-
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 page view event #1910
Open
martinkuba
wants to merge
2
commits into
open-telemetry:main
Choose a base branch
from
martinkuba:browser-page-view-event
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 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 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,51 @@ | ||
<!--- 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. | ||
|
||
## Page View Event | ||
|
||
<!-- semconv event.browser.page_view --> | ||
<!-- 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.page_view`. | ||
|
||
This event represents a browser page load/view. | ||
|
||
The primary use case is to capture metrics about the number of views of a page. Page view can be a hard page load in a browser as well as virtual navigation in a SPA (single-page application). The event should be collected as soon as possible without waiting for potentially delayed data such as the Navigation timing browser API. | ||
|
||
**Body fields:** | ||
|
||
| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | ||
|---|---|---|---|---|---| | ||
| `change_state` | string | Type of state change used for the virtual page navigation | `pushState`; `replaceState` | `Recommended` |  | | ||
| `referrer` | string | Referring Page URI (document.referrer) whenever available. | `https://en.wikipedia.org/wiki/Main_Page` | `Recommended` |  | | ||
| `title` | string | Page title DOM property | `Home`; `Checkout` | `Recommended` |  | | ||
| `type` | enum | Type of navigation | `0`; `1` | `Required` |  | | ||
| `url` | string | Full HTTP request URL in the form scheme://host[:port]/path?query[#fragment]. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | `https://en.wikipedia.org/wiki/Main_Page`; `https://en.wikipedia.org/wiki/Main_Page#foo` | `Required` |  | | ||
|
||
`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 | | ||
|---|---|---| | ||
| `0` | Initial page load within the browser which will generally also precede a PageNavigationTiming event. |  | | ||
| `1` | This is for Single Page Applications (SPA) where the framework provides the ability to perform client side only page "navigation", the exact definition of what a virtual page change is determined by the SPA and the framework it is using. |  | | ||
Comment on lines
+43
to
+44
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. do these values ( |
||
|
||
<!-- markdownlint-restore --> | ||
<!-- prettier-ignore-end --> | ||
<!-- END AUTOGENERATED TEXT --> | ||
<!-- endsemconv --> | ||
|
||
[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status |
This file contains 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,67 @@ | ||
groups: | ||
- id: event.browser.page_view | ||
stability: development | ||
type: event | ||
name: browser.page_view | ||
brief: > | ||
This event represents a browser page load/view. | ||
note: > | ||
The primary use case is to capture metrics about the number of views of | ||
a page. Page view can be a hard page load in a browser as well as virtual | ||
navigation in a SPA (single-page application). The event should be | ||
collected as soon as possible without waiting for potentially delayed | ||
data such as the Navigation timing browser API. | ||
body: | ||
id: browser.page_view | ||
requirement_level: required | ||
stability: development | ||
type: map | ||
fields: | ||
- id: referrer | ||
type: string | ||
stability: development | ||
brief: Referring Page URI (document.referrer) whenever available. | ||
requirement_level: recommended | ||
examples: ["https://en.wikipedia.org/wiki/Main_Page"] | ||
- id: type | ||
type: enum | ||
members: | ||
- id: physical_page | ||
value: 0 | ||
stability: development | ||
brief: > | ||
Initial page load within the browser which will generally also | ||
precede a PageNavigationTiming event. | ||
- id: virtual_page | ||
value: 1 | ||
stability: development | ||
brief: > | ||
This is for Single Page Applications (SPA) where the framework | ||
provides the ability to perform client side only page | ||
"navigation", the exact definition of what a virtual page | ||
change is determined by the SPA and the framework it is using. | ||
stability: development | ||
requirement_level: required | ||
brief: Type of navigation | ||
examples: [0, 1] | ||
- id: title | ||
type: string | ||
stability: development | ||
requirement_level: recommended | ||
brief: Page title DOM property | ||
examples: ["Home", "Checkout"] | ||
- id: url | ||
type: string | ||
stability: development | ||
requirement_level: required | ||
brief: > | ||
Full HTTP request URL in the form scheme://host[:port]/path?query[#fragment]. | ||
Usually the fragment is not transmitted over HTTP, but if it is | ||
known, it should be included nevertheless. | ||
examples: ["https://en.wikipedia.org/wiki/Main_Page", "https://en.wikipedia.org/wiki/Main_Page#foo"] | ||
- id: change_state | ||
type: string | ||
stability: development | ||
requirement_level: recommended | ||
brief: Type of state change used for the virtual page navigation | ||
examples: ["pushState", "replaceState"] |
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.
just from my reading of the description this could be better?