effect-io-ai

Package: effect
Module: Effect

Effect.withTracerEnabled

Enables or disables tracing for spans created by the given effect.

Details

When enabled is false, spans created inside the effect are not registered with the current tracer and do not propagate as normal trace parents.

Example (Enabling or disabling tracing)

import { Effect } from "effect"

Effect.succeed(42).pipe(
  Effect.withSpan("my-span"),
  // the span will not be registered with the tracer
  Effect.withTracerEnabled(false)
)

Signature

declare const withTracerEnabled: { (enabled: boolean): <A, E, R>(effect: Effect<A, E, R>) => Effect<A, E, R>; <A, E, R>(effect: Effect<A, E, R>, enabled: boolean): Effect<A, E, R>; }

Source

Since v2.0.0