ExternalSpanRepresents a span created outside Effect's tracer, carrying trace and span identifiers, sampling state, and annotations so it can be used as a parent or link in Effect tracing.
Example (Creating an external span value)
import { Context } from "effect"
import type { Tracer } from "effect"
// Create an external span from another tracing system
const externalSpan: Tracer.ExternalSpan = {
_tag: "ExternalSpan",
spanId: "span-abc-123",
traceId: "trace-xyz-789",
sampled: true,
annotations: Context.empty()
}
console.log(`External span: ${externalSpan.spanId}`)models
Source effect/Tracer.ts:1967 lines
export interface ExternalSpan {
readonly ExternalSpan._tag: "ExternalSpan"_tag: "ExternalSpan"
readonly ExternalSpan.spanId: stringspanId: string
readonly ExternalSpan.traceId: stringtraceId: string
readonly ExternalSpan.sampled: booleansampled: boolean
readonly ExternalSpan.annotations: Context.Context<never>(property) ExternalSpan.annotations: {
mapUnsafe: ReadonlyMap<string, any>;
mutable: boolean;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
annotations: import ContextContext.type Context.Context = /*unresolved*/ anyContext<never>
}Referenced by 4 symbols