Repository navigation
Added
- The standalone build's handle is reachable. The
<script>build
started itself from itsdata-*attributes but kept the handle, so a page
could not callsetUser,trackorerror. It is now
window.Telemetry.client. Code that may run before the script loads pushes
callbacks ontowindow.TelemetryQueue
((window.TelemetryQueue = window.TelemetryQueue || []).push((t) => t.setUser('42'))).
They run in order once the SDK has started, and a laterpush()runs at
once. A manualwindow.Telemetry.init()does the same. data-user-idsets the user id from the script tag (data-userstill
works).ATTR.USER_IDis exported.
Changed
init()runs once per page. A second call returns the first handle and
ignores its config (debug: truelogs a warning) instead of building a
second tracer and adding a second set of error, history and navigation
listeners. This also covers the npm build and the script tag on the same
page. A sampled-out page stays sampled out.- The user id is
user.id, notenduser.id. laravel-telemetry stamps
user.idon its request spans and telemetry-ui's user dimension reads
user.id, so browser spans were missing from per-user views. (Both keys
are valid OTel attributes today;user.idis the one the backend uses.)
ATTR.ENDUSER_IDis deprecated and is now an alias ofuser.id.
Upgrade note: queries or dashboards that filter browser spans on
enduser.idmust useuser.id.
Fixed
- The page-load span can no longer throw. It is recorded from a timer,
outside any guard, so a browser withoutperformance.getEntriesByType
raised an uncaught error. It now records no page-load span instead.
The standalone build is ~9.7 KB gzipped (+0.2 KB).