DevTools
High-level layers for connecting an Effect runtime to the unstable devtools tracer.
DevTools is the application-facing entry point for installing a tracer that mirrors the current tracer and streams spans, span events, span completions, and metric snapshots to an external devtools process. Lower-level socket protocol details live in DevToolsClient.
Layers
Signature
declare function layer(url: string): Layer<never>;layerSocket
Added in v4.0.0
Source
Layer that installs the devtools tracer using an existing Socket.
Signature
declare const layerSocket: Layer.Layer<never, never, Socket.Socket>;layerWebSocket
Added in v4.0.0
Source
Layer that installs the devtools tracer over a WebSocket connection to the specified URL, defaulting to ws://localhost:34437.
Signature
declare function layerWebSocket(url: string): Layer<never, never, WebSocketConstructor>;
Layer that installs the devtools tracer over a WebSocket connection using the global WebSocket constructor, defaulting to
ws://localhost:34437.When to use
Use to stream Effect tracing and metrics telemetry to a devtools process when the runtime environment already provides a global
WebSocketconstructor.Details
This is a convenience wrapper around
layerWebSocket(url)that providesSocket.layerWebSocketConstructorGlobal, so the resulting layer has no remaining requirements.Gotchas
This layer only installs the client-side tracer; it does not start a devtools server, so the configured WebSocket endpoint must already be reachable. It relies on
globalThis.WebSocketbeing available in the runtime.See
layerWebSocketfor installing the devtools tracer with an explicitWebSocketConstructorrequirementlayerSocketfor installing the devtools tracer over an existingSockettransport