Hyperlinkv0.8.0-beta.28

Effect

Effect.withParentSpanconsteffect/Effect.ts:8411
(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>>

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"
})
tracing
Source effect/Effect.ts:84114 lines
export 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>>
} = internal.withParentSpan