-
Notifications
You must be signed in to change notification settings - Fork 282
Add Browser Resource Timing Event #1943
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
Changes from all commits
478d623
24f3c96
f6cddd0
011b5a2
ce4cb2c
fa01e4f
f3a6c50
350646e
f01be00
ab4c068
7053443
37ceea6
1994b48
d51602d
67348e9
ba39403
cdb74f5
b28851b
3280b6d
2badeee
f29f9d1
fdaa47c
e9adf16
fa645fe
e2069b4
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,22 @@ | ||
| # Use this changelog template to create an entry for release notes. | ||
| # | ||
| # If your change doesn't affect end users you should instead start | ||
| # your pull request title with [chore] or use the "Skip Changelog" label. | ||
|
|
||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: new_component | ||
|
|
||
| # The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) | ||
| component: browser | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: Add `browser.resource_timing` event. | ||
|
|
||
| # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
| # The values here must be integers. | ||
| issues: [1943] | ||
|
|
||
| # (Optional) One or more lines of additional information to render under the primary note. | ||
| # These lines will be padded with 2 spaces and then inserted directly into the document. | ||
| # Use pipe (|) for multiline entries. | ||
| subtext: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,4 +51,50 @@ semantic convention tooling supports complex attributes | |
| <!-- END AUTOGENERATED TEXT --> | ||
| <!-- endsemconv --> | ||
|
|
||
| ## Resource Timing Event | ||
|
|
||
| <!-- semconv event.browser.resource_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.resource_timing`. | ||
|
|
||
| This event describes the timing metrics as provided by PerformanceResourceTiming Performance API. These metrics are related to fetching a resource, such as XMLHttpRequest, Fetch, sendBeacon APIs, SVG, image or script. | ||
|
|
||
| This event captures data from the [ResourceTiming](https://www.w3.org/TR/resource-timing/). It is recommended to be captured by using the PerformanceResourceTiming API. 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. | ||
|
|
||
| | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | ||
| |---|---|---|---|---|---| | ||
| | [`url.full`](/docs/attributes-registry/url.md) | string | Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) [1] | `https://www.foo.bar/search?q=OpenTelemetry#SemConv`; `//localhost` | `Required` |  | | ||
|
|
||
| **[1] `url.full`:** Generally the url doesn't include any query strings or any leading credentials, and it's formatted as scheme://full domain/path only, for example https://user:[email protected]/path?a=b&c=d would be sent as https://www.example.com/path by both removing any potential PII and reducing the cardinality of the name. | ||
|
|
||
| **Body fields:** | ||
|
|
||
| :warning: Body fields will be moved to complex attributes once the | ||
| semantic convention tooling supports complex attributes | ||
| (see [#1870](https://github.com/open-telemetry/semantic-conventions/issues/1870)). | ||
|
|
||
| | Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | ||
| |---|---|---|---|---|---| | ||
| | `connectEnd` | double | The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately after the browser finishes establishing the connection to the server to retrieve the resource, in milliseconds. See [connectEnd](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/connectEnd). | `476.6000000014906` | `Recommended` |  | | ||
| | `connectStart` | double | The [time] (https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately before the user agent starts establishing the connection to the server to retrieve the resource, in milliseconds. See [connectStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/connectStart). | `476.6000000014901` | `Recommended` |  | | ||
| | `domainLookupEnd` | double | The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately after the browser finishes the domain name lookup for the resource, in milliseconds. See [domainLookupEnd](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/domainLookupEnd). | `100.6000000014906` | `Recommended` |  | | ||
| | `domainLookupStart` | double | The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately before the browser starts the domain name lookup for the resource, in milliseconds. See [domainLookupStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/domainLookupStart). | `100.6000000014901` | `Recommended` |  | | ||
| | `fetchStart` | double | The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately before the browser starts to fetch the resource, in milliseconds. See [fetchStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/fetchStart). | `9.600000000558794` | `Recommended` |  | | ||
| | `requestStart` | double | The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately before the browser starts requesting the resource from the server, cache, or local resource, in milliseconds. See [requestStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/requestStart). | `506.70000000298023` | `Recommended` |  | | ||
| | `responseEnd` | double | The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first, in milliseconds. See [responseEnd](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/responseEnd). | `510.6000000014906` | `Recommended` |  | | ||
| | `responseStart` | double | The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately after the browser receives the first byte of the response from the server, cache, or local resource, in milliseconds. See [responseStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/responseStart). | `508.6000000014901` | `Recommended` |  | | ||
| | `secureConnectionStart` | double | The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately before the browser starts the handshake process to secure the current connection, in milliseconds. See [secureConnectionStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/secureConnectionStart). | `476.6000000014903` | `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 |
|---|---|---|
|
|
@@ -52,3 +52,110 @@ groups: | |
| brief: A unique ID representing this particular metric instance. | ||
| requirement_level: required | ||
| examples: ["v3-1677874579383-6381583661209"] | ||
| - id: event.browser.resource_timing | ||
| stability: development | ||
| type: event | ||
| name: browser.resource_timing | ||
| brief: > | ||
| This event describes the timing metrics as provided by PerformanceResourceTiming Performance API. | ||
| These metrics are related to fetching a resource, such as | ||
| XMLHttpRequest, Fetch, sendBeacon APIs, SVG, image or script. | ||
| note: > | ||
| This event captures data from the [ResourceTiming](https://www.w3.org/TR/resource-timing/). | ||
| It is recommended to be captured by using the PerformanceResourceTiming API. | ||
| 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. | ||
| attributes: | ||
| - ref: url.full | ||
| requirement_level: required | ||
| note: > | ||
| Generally the url doesn't include any query strings or any leading credentials, | ||
|
Comment on lines
+69
to
+72
Member
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. @open-telemetry/specs-semconv-maintainers do you see any issue with using 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. Some platforms use querystring params to resize images. If you strip it down to just domain and path, you won't have a complete picture of which size assets loaded. I understand the high cardinality issue but wanted to call this case out. 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. Should we include query string separately? |
||
| and it's formatted as scheme://full domain/path only, for example https://user:[email protected]/path?a=b&c=d | ||
| would be sent as https://www.example.com/path by both removing any potential PII and reducing the cardinality of the name. | ||
| body: | ||
trask marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| id: browser.resource_timing | ||
| requirement_level: required | ||
| stability: development | ||
| type: map | ||
| fields: | ||
| - id: fetchStart | ||
| type: double | ||
| stability: development | ||
| brief: > | ||
| The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately before | ||
| the browser starts to fetch the resource, in milliseconds. | ||
| See [fetchStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/fetchStart). | ||
| requirement_level: recommended | ||
| examples: [9.600000000558794] | ||
| - id: domainLookupStart | ||
| type: double | ||
| stability: development | ||
| brief: > | ||
| The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately before | ||
| the browser starts the domain name lookup for the resource, in milliseconds. | ||
| See [domainLookupStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/domainLookupStart). | ||
| requirement_level: recommended | ||
| examples: [100.6000000014901] | ||
| - id: domainLookupEnd | ||
| type: double | ||
| stability: development | ||
| brief: > | ||
| The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately after | ||
| the browser finishes the domain name lookup for the resource, in milliseconds. | ||
| See [domainLookupEnd](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/domainLookupEnd). | ||
| requirement_level: recommended | ||
| examples: [100.6000000014906] | ||
| - id: connectStart | ||
Karlie-777 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type: double | ||
| stability: development | ||
| brief: > | ||
trask marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| The [time] (https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately before | ||
| the user agent starts establishing the connection to the server to retrieve the resource, in milliseconds. | ||
| See [connectStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/connectStart). | ||
| requirement_level: recommended | ||
| examples: [476.6000000014901] | ||
| - id: secureConnectionStart | ||
| type: double | ||
| stability: development | ||
| brief: > | ||
| The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately before | ||
| the browser starts the handshake process to secure the current connection, in milliseconds. | ||
| See [secureConnectionStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/secureConnectionStart). | ||
| requirement_level: recommended | ||
| examples: [476.6000000014903] | ||
| - id: connectEnd | ||
| type: double | ||
| stability: development | ||
| brief: > | ||
| The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately after | ||
| the browser finishes establishing the connection to the server to retrieve the resource, in milliseconds. | ||
| See [connectEnd](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/connectEnd). | ||
| requirement_level: recommended | ||
| examples: [476.6000000014906] | ||
| - id: requestStart | ||
| type: double | ||
| stability: development | ||
| brief: > | ||
| The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately before | ||
| the browser starts requesting the resource from the server, cache, or local resource, in milliseconds. | ||
| See [requestStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/requestStart). | ||
| requirement_level: recommended | ||
| examples: [506.70000000298023] | ||
| - id: responseStart | ||
| type: double | ||
| stability: development | ||
| brief: > | ||
| The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately after | ||
| the browser receives the first byte of the response from the server, cache, or local resource, in milliseconds. | ||
| See [responseStart](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/responseStart). | ||
| requirement_level: recommended | ||
| examples: [508.6000000014901] | ||
| - id: responseEnd | ||
| type: double | ||
| stability: development | ||
| brief: > | ||
| The [time](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) immediately after | ||
| the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first, | ||
| in milliseconds. See [responseEnd](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/responseEnd). | ||
| requirement_level: recommended | ||
| examples: [510.6000000014906] | ||
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 think this URL is for the resource described by this event, not the page URL, correct? I think we should note this in the description of this attribute, so that it is clear.
Also, if this is the resource URL, why is it listed as an attribute rather than a body field like the measurements?