Hyperlinkv0.8.0-beta.28

Tracer

Tracer.ParentSpanclasseffect/Tracer.ts:168
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}`)
})
services
Source effect/Tracer.ts:1681 lines
export class ParentSpan extends Context.Service<ParentSpan, AnySpan>()(ParentSpanKey) {}
Referenced by 12 symbols