pi-mono/packages/chord/test/examples/62-telemetry/worker.ts
Mario Zechner ff33ef42c4 feat(chord): telemetry from pages and workers stored by the server, who a span was for
The four telemetry gaps (rows on commits, chord.host, microsecond times, a read-only store) and: pages record and
send span batches over their link to the server's ingest object (checked, capped, rate-limited, stamped browser and
with the link's principal); workers send theirs too, so the server is the store's only writer; principalAttributes
lets an app choose what a span records about its principal. The tutorial shows a real page's click traced to the
worker, with the trace viewer.
2026-11-04 11:59:14 +00:00

8 lines
504 B
TypeScript

// The tally app's worker entry: one process per tally. It records in memory and sends its spans and metrics to the
// server, which stores them (the kit does it when the server has a telemetry store). Its methods called through the
// server continue the caller's trace: the carrier travels on the wire.
import { startWorker } from "../../../src/node/app/index.ts";
import { API, KINDS } from "./start.ts";
startWorker({ api: API, kinds: KINDS, onError: (error) => console.error("worker:", error) });