Trace Story
A typical browser-to-actor method call produces a connected trace across client, transport, actor, and event handling.
Browser to actor
- The browser calls
client.fn("Move")(...). Client.fncreates a client span.- The client encodes that span into
F.Payload.trace. - The Durable Object receives the WebSocket message and creates a
socket-messagetransport span. - The actor handler span is parented to
F.Payload.traceand linked to the local transport span. - If the handler emits an event,
event.sendcreates a producer span and attachesEvent.trace. - The browser receives the event and creates an
event.enqueueconsumer span parented toEvent.trace. - The response listener resolves the original call under the stored client span. There is no separate response span.
event.enqueue covers Liminal publishing the event into the client's internal PubSub. It does not implicitly parent
arbitrary Client.events stream consumers; app-level event processing should create its own spans if that distinction
matters.
HTTP upgrade
The HTTP upgrade path also participates:
Worker.fetchextracts incomingtraceparentor B3 headers and creates a server span.WorkerdActorNamespace.upgraderuns under that span.- The namespace forwards trace headers to
stub.fetch. - The actor runtime
fetchcallback extracts those headers inside the Durable Object and creates the Durable Object-side server span. It also creates the socket session id and persists the session trace in the WebSocket attachment.
Read Propagation for the trace envelope details.