Hyperlinkv0.8.0-beta.28

Layer

Layer.SpanOptionsinterfaceeffect/Layer.ts:2447
SpanOptions

Represents options that can be used to control the behavior of spans created for layers.

When to use

Use to configure tracing metadata, stack trace capture, and onEnd finalization for spans created by Layer.span and Layer.withSpan during layer construction.

Details

Extends Tracer.SpanOptions with onEnd, which runs when the layer span ends as the layer scope closes.

Source effect/Layer.ts:24479 lines
export interface SpanOptions extends Tracer.SpanOptions {
  /**
   * Runs when the span associated with the layer ends, which happens when the
   * layer scope is closed.
   */
  readonly onEnd?:
    | ((span: Tracer.Span, exit: Exit.Exit<unknown, unknown>) => Effect<void>)
    | undefined
}
Referenced by 2 symbols