Skip to main content Link Search Menu Expand Document (external link)

Tracer overview

Added in v1.0.0


Table of contents


accessors

currentOtelSpan

Signature

export declare const currentOtelSpan: Effect<Otel.Span, NoSuchElementException>

Added in v1.0.0

constructors

make

Signature

export declare const make: Effect<EffectTracer, never, Otel.Tracer>

Added in v1.0.0

makeExternalSpan

Signature

export declare const makeExternalSpan: (options: {
  readonly traceId: string
  readonly spanId: string
  readonly traceFlags?: number | undefined
  readonly traceState?: string | Otel.TraceState | undefined
}) => ExternalSpan

Added in v1.0.0

layers

layer

Signature

export declare const layer: Layer<never, never, Otel.TracerProvider | Resource>

Added in v1.0.0

layerGlobal

Signature

export declare const layerGlobal: Layer<never, never, Resource>

Added in v1.0.0

layerGlobalTracer

Signature

export declare const layerGlobalTracer: Layer<Otel.Tracer, never, Resource>

Added in v1.0.0

layerTracer

Signature

export declare const layerTracer: Layer<Otel.Tracer, never, Otel.TracerProvider | Resource>

Added in v1.0.0

propagation

withSpanContext

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

export declare const withSpanContext: {
  (spanContext: Otel.SpanContext): <A, E, R>(effect: Effect<A, E, R>) => Effect<A, E, Exclude<R, ParentSpan>>
  <A, E, R>(effect: Effect<A, E, R>, spanContext: Otel.SpanContext): Effect<A, E, Exclude<R, ParentSpan>>
}

Added in v1.0.0

tags

TraceFlags

Signature

export declare const TraceFlags: Tag<Otel.TraceFlags, Otel.TraceFlags>

Added in v1.0.0

TraceState

Signature

export declare const TraceState: Tag<Otel.TraceState, Otel.TraceState>

Added in v1.0.0

Tracer

Signature

export declare const Tracer: Tag<Otel.Tracer, Otel.Tracer>

Added in v1.0.0

TracerProvider

Signature

export declare const TracerProvider: Tag<Otel.TracerProvider, Otel.TracerProvider>

Added in v1.0.0