Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/browser/events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!--- 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.

## 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:** ![Development](https://img.shields.io/badge/-development-blue)

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.

**Body fields:**

| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `connectEnd` | double | The time immediately after the browser finishes establishing the connection to the server to retrieve the resource. The timestamp value includes the time interval to establish the transport connection, as well as other time intervals such as SSL handshake and SOCKS authentication. completes, and it is measured in milliseconds. | `476.6000000014906` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| `connectStart` | double | The time immediately immediately before the user agent starts establishing the connection to the server to retrieve the resource, and it is measured in milliseconds. | `476.6000000014901` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| `domainLookupEnd` | double | The time immediately after the browser finishes the domain name lookup for the resource, and it is measured in milliseconds. | `100.6000000014906` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| `domainLookupStart` | double | The time immediately before the browser starts the domain name lookup for the resource, and it is measured in milliseconds. | `100.6000000014901` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| `fetchStart` | double | The time immediately before the browser starts to fetch the resource, and it is measured in milliseconds. | `9.600000000558794` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| `name` | string | The resolved URL of the requested resource. | `https://en.wikipedia.org/wiki/Main_Page` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| `requestStart` | double | The time immediately before the browser starts requesting the resource from the server, cache, or local resource. If the transport connection fails and the browser retires the request, the value returned will be the start of the retry request, and it is measured in milliseconds. | `506.70000000298023` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| `responseEnd` | double | The time immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first, and it is measured in milliseconds. | `510.6000000014906` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| `responseStart` | double | The time immediately after the browser receives the first byte of the response from the server, cache, or local resource, and it is measured in milliseconds. | `508.6000000014901` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| `secureConnectionStart` | double | The time immediately before immediately before the browser starts the handshake process to secure the current connection, and it is measured in milliseconds. | `476.6000000014903` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
104 changes: 104 additions & 0 deletions model/browser/events.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
groups:
- 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.
body:
id: browser.resource_timing
requirement_level: required
stability: development
type: map
fields:
- id: name
type: string
stability: development
brief: The resolved URL of the requested resource.
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,
and it is measured in milliseconds.
requirement_level: recommended
examples: [9.600000000558794]
- id: domainLookupStart
type: double
stability: development
brief: >
The time immediately before the browser starts the domain name lookup for the resource,
and it is measured in milliseconds.
requirement_level: recommended
examples: [100.6000000014901]
- id: domainLookupEnd
type: double
stability: development
brief: >
The time immediately after the browser finishes the domain name lookup for the resource,
and it is measured in milliseconds.
requirement_level: recommended
examples: [100.6000000014906]
- id: connectStart
type: double
stability: development
brief: >
The time immediately immediately before the user agent starts establishing the connection to the server to retrieve the resource,
and it is measured in milliseconds.
requirement_level: recommended
examples: [476.6000000014901]
- id: secureConnectionStart
type: double
stability: development
brief: >
The time immediately before immediately before the browser starts the handshake process to secure the current connection,
and it is measured in milliseconds.
requirement_level: recommended
examples: [476.6000000014903]
- id: connectEnd
type: double
stability: development
brief: >
The time immediately after the browser finishes establishing the connection to the server to retrieve the resource.
The timestamp value includes the time interval to establish the transport connection,
as well as other time intervals such as SSL handshake and SOCKS authentication.
completes, and it is measured in milliseconds.
requirement_level: recommended
examples: [476.6000000014906]
- id: requestStart
type: double
stability: development
brief: >
The time immediately before the browser starts requesting the resource from the server, cache, or local resource.
If the transport connection fails and the browser retires the request,
the value returned will be the start of the retry request,
and it is measured in milliseconds.
requirement_level: recommended
examples: [506.70000000298023]
- id: responseStart
type: double
stability: development
brief: >
The time immediately after the browser receives the first byte of the response from the server, cache, or local resource,
and it is measured in milliseconds.
requirement_level: recommended
examples: [508.6000000014901]
- id: responseEnd
type: double
stability: development
brief: >
The time immediately after the browser receives the last byte of the resource
or immediately before the transport connection is closed, whichever comes first,
and it is measured in milliseconds.
requirement_level: recommended
examples: [510.6000000014906]