Tracer
Accessors
currentOtelSpan
Added in v1.0.0
Source
Signature
declare const currentOtelSpan: Effect<Otel.Span, NoSuchElementException>;Constructors
Signature
declare const make: Effect<EffectTracer, never, OtelTracer>;makeExternalSpan
Added in v1.0.0
Source
Signature
declare const makeExternalSpan: (options: {
readonly spanId: string;
readonly traceFlags?: number;
readonly traceId: string;
readonly traceState?: string | Otel.TraceState;
}) => ExternalSpan;Layers
Signature
declare const layer: Layer<OtelTracer, never, Resource | OtelTracerProvider>;layerGlobal
Added in v1.0.0
Source
Signature
declare const layerGlobal: Layer<OtelTracer, never, Resource>;layerGlobalTracer
Added in v1.0.0
Source
Signature
declare const layerGlobalTracer: Layer<OtelTracer, never, Resource>;layerTracer
Added in v1.0.0
Source
Signature
declare const layerTracer: Layer<OtelTracer, never, Resource | OtelTracerProvider>;layerWithoutOtelTracer
Added in v1.0.0
Source
Signature
declare const layerWithoutOtelTracer: Layer<never, never, OtelTracer>;Propagation
withSpanContext
Added in 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>>;
};
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
Spaninterface.