Spans

Wardic's spans, an app's to give: with layer and a tracer installed (the devtools', an OpenTelemetry exporter's), each animation runs in a span named for what it is, and each burst of frames, gesture, layout pass and exit in one of its own. Without layer, Wardic opens none, and an app ships none of their code. With layer and no tracer, it opens none either.

Example

const env = Layer.mergeAll(DomLive, devtools, Spans.layer)

Interfaces

Options

A span's options: its attributes, and whether it's a root, with no parent.

Properties

attributes?
readonly attributes?: Readonly<Record<string, unknown>>;
root?
readonly root?: boolean;

Variables

layer

const layer: Layer.Layer<never>;

Wardic's spans, given: merged beside an Environment, each animation, burst of frames, gesture, layout pass and exit opens its span under the tracer installed. @wardic/dom gives it as WardicSpans.


missing

const missing: Effect.Effect<boolean> = internal.missing;

Whether a tracer reads the running fiber's spans while the app gives no layer: what a binding warns of in development, as it builds its Environment.


withSpan

const withSpan: {
  (name, options?): <A, E, R>(self) => Effect<A, E, R>;
  <A, E, R>(self, name, options?): Effect<A, E, R>;
};

self under the span name, opened as Wardic's own are: when the app gives layer and a tracer reads it, with no call-site stack. As it is otherwise. For a binding's own spans.

Call Signature

(name, options?): <A, E, R>(self) => Effect<A, E, R>;
Parameters
name

string

options?

Options

Returns

<A, E, R>(self) => Effect<A, E, R>

Call Signature

<A, E, R>(
   self, 
   name, 
   options?
): Effect<A, E, R>;
Type Parameters
A

A

E

E

R

R

Parameters
self

Effect<A, E, R>

name

string

options?

Options

Returns

Effect<A, E, R>

Example

const measured = pass.pipe(Spans.withSpan("app.measure", { attributes: { nodes: 3 } }))