Tracer
Accessors
Since v1.0.0 Source
Get the current OpenTelemetry span.
Works with both the official OpenTelemetry API (via Tracer.layer, NodeSdk.layer, etc.)
and the lightweight OTLP module (OtlpTracer.layer).
When using OTLP, the returned span is a wrapper that conforms to the
OpenTelemetry Span interface.
Signature
declare const currentOtelSpan: Effect<Otel.Span, NoSuchElementException>Constructors
Signature
declare const make: Effect<EffectTracer, never, OtelTracer> Since v1.0.0 Source
Signature
declare const makeExternalSpan: (options: { readonly spanId: string; readonly traceFlags?: number; readonly traceId: string; readonly traceState?: string | Otel.TraceState;}) => ExternalSpanLayers
Signature
declare const layer: Layer<OtelTracer, never, Resource | OtelTracerProvider> Since v1.0.0 Source
Signature
declare const layerGlobal: Layer<OtelTracer, never, Resource> Since v1.0.0 Source
Signature
declare const layerGlobalTracer: Layer<OtelTracer, never, Resource> Since v1.0.0 Source
Signature
declare const layerTracer: Layer<OtelTracer, never, Resource | OtelTracerProvider> Since v1.0.0 Source
Signature
declare const layerWithoutOtelTracer: Layer<never, never, OtelTracer>Propagation
Since v1.0.0 Source
Set the effect's parent span from the given opentelemetry SpanContext.
This is handy when you set up OpenTelemetry outside of Effect and want to attach to a parent span.
Signature
declare const withSpanContext: { (spanContext: SpanContext): <A, E, R>(effect: Effect<A, E, R>) => Effect<A, E, Exclude<R, ParentSpan>>; <A, E, R>(effect: Effect<A, E, R>, spanContext: SpanContext): Effect<A, E, Exclude<R, ParentSpan>>;}