effect-io-ai

Package: effect
Module: Tracer

Tracer.ParentSpan

Context service containing the Span or ExternalSpan to use as the parent of newly-created child spans.

Example (Accessing the parent span)

import { Effect, Tracer } from "effect"

// Access the parent span from the context
const program = Effect.gen(function*() {
  const parentSpan = yield* Effect.service(Tracer.ParentSpan)
  console.log(`Parent span: ${parentSpan.spanId}`)
})

Signature

declare class ParentSpan

Source

Since v2.0.0