Repository navigation
feat: add browser semantic conventions - #14
Conversation
58dc2fc to
ffe2326
Compare
adityareddy-dev
left a comment
There was a problem hiding this comment.
Went through the three model files and the generated docs, then ran make check-policies and make generate-docs on the branch and again with main merged in. Both clean, and the docs come out byte for byte the same as what's committed. I also checked the names against what the browser SDK emits today and against core v1.44.0. Every attribute and event name matches the SDK exactly and nothing collides with core.
Good to see the Timing-Allow-Origin warning up front in the resource_timing note, a zero that means "not available" is easy to misread in this data.
The comments are small model and wording fixes, nothing that should hold this up for long. The one I'd want fixed before merge is duration on navigation_timing, as it stands that brief is wrong for the event.
| [PerformanceResourceTiming](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming) | ||
| API. | ||
| note: > | ||
| The timings are in milliseconds, relative to the time origin of the document. |
There was a problem hiding this comment.
Could we clarify whether the event timestamp means resource start or completion? The SDK currently emits these during idle time without an explicit timestamp, so it can end up reflecting collection time instead.
There was a problem hiding this comment.
I am leaning toward start time, which is useful for performance timelines and waterfalls. I have made that change, but let me know if you feel differently.
There was a problem hiding this comment.
Start time is the right call here. It puts the event on the same clock as the resource timing events, and a waterfall needs the start anyway, the duration can be derived from the milestones but not the other way around.
| type: int | ||
| stability: development | ||
| brief: > | ||
| The size, in bytes, of the fetched resource, including the response header fields and the |
There was a problem hiding this comment.
Could we call this the browser-reported transfer size? The spec uses a fixed 300 bytes for headers, with different values for cached responses. This wording makes it sound like an exact byte count.
| brief: > | ||
| Time of the start of the fetch that initiated the first redirect. | ||
| note: > | ||
| Zero if there was no redirect, or if a redirect is not same-origin. |
There was a problem hiding this comment.
Cross-origin redirects can expose timings when the timing-allow checks pass. Could we say zero when there's no redirect or those checks fail? Same applies to redirect_end.
adityareddy-dev
left a comment
There was a problem hiding this comment.
All six threads came back addressed. Splitting navigation into the Navigation API type and the navigation_timing type reads much cleaner than overloading one attribute, and the severity defaults and the time origin notes close the gaps I flagged. Keeping the raw ALPN value with the note pointing at network.protocol.name and network.protocol.version is the right trade. Approving.
|
One implementation follow-up for the start-time requirement. The current browser resource instrumentation queues entries for idle processing and emits the record without Could we link the companion SDK change here? I'd add a regression test with a nonzero |
|
The resource-timing event timestamp is tracked in open-telemetry/opentelemetry-browser#496. |
Ports the browser conventions from open-telemetry/opentelemetry-browser#404, migrated from
weaver v1 to
definition/2.Scope is browser-specific only: 33 attributes and 4 events covering
PerformanceNavigationTiming,PerformanceResourceTiming, the console method, and thenavigation type / same-document / hash-change attributes.
Left out of this PR
browser.user_action.clickattributes, which duplicate upstream'sevent.app.widget.click(already in v1.44.0) and belong in a shared client-side namespacespan.browser.http.client, which only restates an upstream attribute's requirement levelimports:ofbrowser.web_vitalandexception, which exist in the source repo forits code generation.
Verified locally against that branch:
make check-policiesandmake testpass, andmake generate-allproduces 33 attributes, 4 events and 1 group.