feat: apply unified HTTP semantic conventions to resource timing#232
feat: apply unified HTTP semantic conventions to resource timing#232martinkuba wants to merge 5 commits into
Conversation
|
@martinkuba As we discussed yesterday and you pointed out that there's a solution to the following concerns: Concern:
Solution:
For the other remaining concern:
You mentioned the browser sig thought of providing flexibility to the customers on choosing which semantic conventions to use and keep both browser specific and unified semantic conventions. Can you please add this proposal to the unified semantics issue? Regarding the follow up items:
My responses to above items:
|
|
@martinkuba I got a chance to look at the remaining items not covered in above response and here are my responses:
|
Yes, this is correct. This diagram shows how the different timestamps relate to each other: taken from here: |


This is a draft PR to demonstrate how the unified HTTP client network timing conventions from semantic-conventions#3385 would look when applied to the resource timing instrumentation. The goal is to provide a concrete implementation to inform discussion.
Changes
browser.resource.timing→browser.resource_timingbrowser.resource.*tohttp.*namespace (e.g.,http.call.start_time,http.dns.start_time,http.connect.start_time)http.call.start_timeis absolute (ms since epoch); all other timing attributes are deltas from it. Browser API values of 0 (phase did not occur) are omitted.nextHopProtocolsplit intonetwork.protocol.name+network.protocol.versionhttp.response.status_code,http.response.header.content-type,http.response.body.encoded_size,http.response.body.decoded_sizeurl.full,http.response.status_code,http.response.size,network.protocol.name,network.protocol.versionAttribute mapping
fetchStarthttp.call.start_timeresponseEndhttp.call.end_timedurationhttp.call.durationredirectStart/Endhttp.redirect.start_time/end_timedomainLookupStart/Endhttp.dns.start_time/end_timeconnectStart/Endhttp.connect.start_time/end_timesecureConnectionStarthttp.secure_connect.start_timerequestStarthttp.request.headers.start_timeresponseStarthttp.response.headers.start_timeworkerStarthttp.worker.start_timetransferSizehttp.response.sizeencodedBodySizehttp.response.body.encoded_sizedecodedBodySizehttp.response.body.decoded_sizeresponseStatushttp.response.status_codecontentTypehttp.response.header.content-typenameurl.fullnextHopProtocolnetwork.protocol.name+.versioninitiatorTypebrowser.resource.initiator_typerenderBlockingStatusbrowser.resource.render_blocking_statusHere is what user would see in the browser dev console when debugging:
And this corresponds to this resource timing object:
Open questions for discussion
Key concerns — should we adopt the unified conventions for browser?
timeOrigin; this convention uses deltas relative to request start. Anyone cross-referencing DevTools with telemetry data will see different values for the same phase.http.call.start_timeis ~1.7 trillion whilehttp.call.end_timeis ~100 — looks like a bug when eyeballing raw data.Follow-up items if we adopt the unified conventions
http.dns.start_timevsdns.start_time— DNS is not HTTP-specifichttp.call.durationandhttp.call.end_timeare always identicalstartTimevsfetchStart:startTimeis the true beginning (includes redirects),fetchStartis after redirects. Which shouldhttp.call.start_timerepresent?transferSize: 0semantics: Means cache hit — should it be sent as explicit signal or omitted?http.response.body.sizeis ambiguous (see semconv#3406); this PR uses explicitencoded_size/decoded_sizeinstead