Summary
Create a docs/resource-timing-event.md document (following the pattern of docs/navigation-event.md) that defines the browser.resource_timing event and its attribute mappings. Update docs/browser-observability-model.md to link to the new doc and reference the latest semconv status.
This is based on the unified HTTP client network timing conventions decided in semantic-conventions#3385.
Tasks
- Create
docs/resource-timing-event.md with purpose, use cases, and full attribute mapping tables
- Update
docs/browser-observability-model.md:
- Link the
browser.resource_timing event name to the new doc
- Update Semantic Conventions Status to reference semantic-conventions#3385
Key decisions from semconv#3385
- Signal type: Event (not metric, not span attributes)
- Event name:
browser.resource_timing
- Delta time model:
http.call.start_time is absolute (ms since epoch); all others are deltas from it
- Browser API values of
0 mean the phase did not occur -- omit the attribute
- Browser natively provides deltas relative to timeOrigin; instrumentation converts to deltas relative to
http.call.start_time
- Events work better for browser because timing data arrives asynchronously and the API covers all resource types (CSS, JS, images, etc.), not just fetch/XHR
Event metadata
- Timestamp:
http.call.start_time (when the fetch started)
- ObservedTimestamp: when the event is emitted
- Context: context of the original HTTP span (if one exists) for correlation
Timing attribute mapping
| Browser API field |
Proposed attribute |
Requirement |
Notes |
| fetchStart |
http.call.start_time |
Required |
Absolute timestamp (ms since epoch) |
| responseEnd |
http.call.end_time |
Required |
Delta from start_time |
| redirectStart |
http.redirect.start_time |
Opt-In |
Omit if 0 (no redirect). Browser only. |
| redirectEnd |
http.redirect.end_time |
Opt-In |
Omit if 0. Browser only. |
| domainLookupStart |
http.dns.start_time |
Opt-In |
Omit if 0 (reused connection) |
| domainLookupEnd |
http.dns.end_time |
Opt-In |
|
| connectStart |
http.connect.start_time |
Opt-In |
|
| connectEnd |
http.connect.end_time |
Opt-In |
Also implicitly TLS end |
| secureConnectionStart |
http.secure_connect.start_time |
Opt-In |
HTTPS only, omit if 0 |
| requestStart |
http.request.headers.start_time |
Opt-In |
Browser exposes only a single request start |
| responseStart |
http.response.headers.start_time |
Opt-In |
First byte received (TTFB) |
| workerStart |
http.worker.start_time |
Opt-In |
Omit if 0 (no service worker). Browser only. |
Browser does not expose: http.secure_connect.end_time, http.request.headers.end_time, http.request.body.*, http.response.headers.end_time, http.response.body.*
Additional resource attributes
| Browser API field |
Proposed attribute |
Notes |
| responseStatus |
http.response.status_code |
|
| encodedBodySize |
http.response.body.size |
|
| transferSize |
http.response.size |
|
| decodedBodySize |
TBD |
May need separate attribute |
| contentType |
http.response.header.content-type |
Value from Resource Timing API |
| nextHopProtocol |
network.protocol.name + network.protocol.version |
Needs parsing |
| initiatorType |
TBD |
Browser-specific, likely separate namespace |
| deliveryType |
TBD |
Browser-specific, likely separate namespace |
| renderBlockingStatus |
TBD |
Browser-specific, likely separate namespace |
| serverTiming |
TBD |
Possibly http.response.header.server-timing |
Optional: copy of original HTTP span attributes
A configurable option to include original HTTP span attributes on the event for backends that cannot yet correlate signals:
| Attribute |
Type |
Example |
| url.full |
string |
https://api.example.com/users |
| http.request.method |
string |
GET |
| http.response.status_code |
int |
200 |
| server.address |
string |
example.com |
| server.port |
int |
443 |
| network.protocol.version |
string |
2 |
Open questions
- Should timing attributes be modeled as complex attributes? (raised by @breedx-splk)
- All vs curated list of original HTTP span attributes? (raised by @bidetofevil)
- Attribute naming for dns/tls/worker -- thompson-tomo proposed
dns.question.*, tls.connect.*, browser.web_worker.* instead of http.dns.*, http.secure_connect.*, http.worker.*
Summary
Create a
docs/resource-timing-event.mddocument (following the pattern ofdocs/navigation-event.md) that defines thebrowser.resource_timingevent and its attribute mappings. Updatedocs/browser-observability-model.mdto link to the new doc and reference the latest semconv status.This is based on the unified HTTP client network timing conventions decided in semantic-conventions#3385.
Tasks
docs/resource-timing-event.mdwith purpose, use cases, and full attribute mapping tablesdocs/browser-observability-model.md:browser.resource_timingevent name to the new docKey decisions from semconv#3385
browser.resource_timinghttp.call.start_timeis absolute (ms since epoch); all others are deltas from it0mean the phase did not occur -- omit the attributehttp.call.start_timeEvent metadata
http.call.start_time(when the fetch started)Timing attribute mapping
Browser does not expose:
http.secure_connect.end_time,http.request.headers.end_time,http.request.body.*,http.response.headers.end_time,http.response.body.*Additional resource attributes
Optional: copy of original HTTP span attributes
A configurable option to include original HTTP span attributes on the event for backends that cannot yet correlate signals:
Open questions
dns.question.*,tls.connect.*,browser.web_worker.*instead ofhttp.dns.*,http.secure_connect.*,http.worker.*