Commit af28b90
feat(traces): span handles
Adds the Span interface (posthog.tracing.span, the only public module in the
package) and its handles. The recording span keeps its timing on a monotonic
clock, with children of a local parent on the root's clock basis so they stay
inside it; end() is idempotent and hands the pipeline one record. The no-op
handle is returned when tracing cannot run, and the pass-through handle echoes
an inbound traceparent and tracestate so a service with tracing off still
forwards the trace, including from spans nested inside it. Entering a handle
makes it the active span for the block and records an exception raised out of
it. Not reachable from the client.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TkZAsCciW4PV8ZdcCHmAbA1 parent 3a26165 commit af28b90
4 files changed
Lines changed: 1090 additions & 0 deletions
0 commit comments