effect-io-ai

Package: effect
Module: Effect

Effect.withParentSpan

Adds the provided span to the current span stack.

Example (Setting a parent span)

import { Effect } from "effect"

const program = Effect.gen(function*() {
  const span = yield* Effect.makeSpan("parent-span")
  const childTask = Effect.log("Child operation")
  yield* Effect.withParentSpan(childTask, span)
  return "completed"
})

Signature

declare const withParentSpan: { (value: AnySpan, options?: TraceOptions): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, ParentSpan>>; <A, E, R>(self: Effect<A, E, R>, value: AnySpan, options?: TraceOptions): Effect<A, E, Exclude<R, ParentSpan>>; }

Source

Since v2.0.0