DevToolsClient
Low-level devtools client and tracer wiring over the current Socket.
DevToolsClient speaks the devtools NDJSON protocol used by the unstable
devtools integration. It sends span starts, span events, span completions,
ping messages, and metric snapshots through a socket, then exposes tracer
layers that forward telemetry while preserving the current tracer's behavior.
Constructors
Creates a devtools client over the current Socket, speaking the devtools
NDJSON protocol, sending periodic pings, and responding to metrics snapshot
requests.
When to use
Use when you already have a Socket and need the low-level DevToolsClient
service to exchange devtools telemetry directly.
Details
The effect requires Scope because it starts background fibers for the socket
stream and heartbeat.
Gotchas
make creates only the client service; tracing is installed separately.
See
- layer for providing the client as a layer
- makeTracer for creating a tracer after a
DevToolsClientis available - layerTracer for creating the client from the current
Socketand installing the tracer as a layer
Signature
declare const make: Effect.Effect<DevToolsClient["Service"], never, Scope.Scope | Socket.Socket>makeTracer
Creates a tracer that delegates to the current tracer while sending span
starts, span events, and span ends to DevToolsClient.
Signature
declare const makeTracer: Effect.Effect<Tracer.Tracer, never, DevToolsClient>Layers
Layer that provides DevToolsClient using the current Socket.
When to use
Use to provide the low-level DevToolsClient service over an existing
Socket for custom devtools integrations that send telemetry through the
client directly.
Details
It delegates to make, so it speaks the devtools NDJSON protocol over the
provided Socket, sends periodic pings, responds to metrics snapshot
requests, and finalizes its background fibers when the layer scope closes.
Gotchas
This layer only provides the client. It does not install the devtools tracer by itself.
See
- make for constructing the client as a scoped effect instead of a layer
- layerTracer for a higher-level layer that creates the client and installs the devtools tracer
Signature
declare const layer: Layer.Layer<DevToolsClient, never, Socket.Socket>layerTracer
Layer that creates a DevToolsClient from the current Socket and installs
the devtools tracer.
Signature
declare const layerTracer: Layer.Layer<never, never, Socket.Socket>Services
DevToolsClient
Service for sending span and span-event telemetry to the Effect devtools connection.
Signature
declare class DevToolsClient extends Shape<"effect/devtools/DevToolsClient", { readonly sendUnsafe: (_: Span | { readonly _tag: "SpanEvent"; readonly attributes: { [key: string]: any; } | undefined; readonly name: string; readonly spanId: string; readonly startTime: bigint; readonly traceId: string; }) => void;}, this> { constructor(_: never);}