docs(chord): spans record who they were for, through an app hook

This commit is contained in:
Mario Zechner 2026-11-04 10:57:57 +00:00
parent 596523e01e
commit 72dd26e084

View file

@ -2536,6 +2536,13 @@ validation and copies the v2 kernel added around Delta.
server spans; the store writes finished spans it receives (a new ingest path). The viewer clamps a browser span
against its server children (clock skew). General Chord: the page recorder in the web surface, the ingest facet, the
store's ingest; the app kit serves the object when given a telemetry store and `startPage` records when the app asks.
- **Who a span was for (owner, 2026-11-04: "that hook could also allow us to resolve the username and put that in the
telemetry if we're fine with that"; refines "IDs are attributes of spans" for principals):** method and call spans
record the principal's attributes, by default its principal key (`chord.principal`), never other app data. A hook in
the host's telemetry options maps a principal to the attributes to record (none, the key, or more, e.g. a user name
the app resolves from its own data); Chord calls it once per principal and caches the result (a `WeakMap` by
principal object, or per principal key), so no per-span lookup. Browser spans are stamped with the principal of the
link their batch came over. The viewer stays the owner's and filters by principal.
- **A plugin's npm dependencies are bundled; external only by opt-in (owner, 2026-10-29: "explicit opt in + (a)"):**
a plugin's `dependencies` are installed into its own `node_modules` (`npm install --ignore-scripts`) and bundled into
each facet that imports them (host packages, its `peerDependencies`, stay external and are passed in). On Node a