Tracer overview
Added in v2.0.0
Table of contents
annotations
DisablePropagation
Signature
export declare const DisablePropagation: Context.Reference<DisablePropagation, boolean>
Added in v3.12.0
DisablePropagation (interface)
Signature
export interface DisablePropagation {
readonly _: unique symbol
}
Added in v3.12.0
constructors
externalSpan
Signature
export declare const externalSpan: (options: {
readonly spanId: string
readonly traceId: string
readonly sampled?: boolean | undefined
readonly context?: Context.Context<never> | undefined
}) => ExternalSpan
Added in v2.0.0
make
Signature
export declare const make: (options: Omit<Tracer, typeof TracerTypeId>) => Tracer
Added in v2.0.0
tracerWith
Signature
export declare const tracerWith: <A, E, R>(f: (tracer: Tracer) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
Added in v2.0.0
models
AnySpan (type alias)
Signature
export type AnySpan = Span | ExternalSpan
Added in v2.0.0
ExternalSpan (interface)
Signature
export interface ExternalSpan {
readonly _tag: "ExternalSpan"
readonly spanId: string
readonly traceId: string
readonly sampled: boolean
readonly context: Context.Context<never>
}
Added in v2.0.0
Span (interface)
Signature
export interface Span {
readonly _tag: "Span"
readonly name: string
readonly spanId: string
readonly traceId: string
readonly parent: Option.Option<AnySpan>
readonly context: Context.Context<never>
readonly status: SpanStatus
readonly attributes: ReadonlyMap<string, unknown>
readonly links: ReadonlyArray<SpanLink>
readonly sampled: boolean
readonly kind: SpanKind
end(endTime: bigint, exit: Exit.Exit<unknown, unknown>): void
attribute(key: string, value: unknown): void
event(name: string, startTime: bigint, attributes?: Record<string, unknown>): void
}
Added in v2.0.0
SpanKind (type alias)
Signature
export type SpanKind = "internal" | "server" | "client" | "producer" | "consumer"
Added in v3.1.0
SpanLink (interface)
Signature
export interface SpanLink {
readonly _tag: "SpanLink"
readonly span: AnySpan
readonly attributes: Readonly<Record<string, unknown>>
}
Added in v2.0.0
SpanOptions (interface)
Signature
export interface SpanOptions {
readonly attributes?: Record<string, unknown> | undefined
readonly links?: ReadonlyArray<SpanLink> | undefined
readonly parent?: AnySpan | undefined
readonly root?: boolean | undefined
readonly context?: Context.Context<never> | undefined
readonly kind?: SpanKind | undefined
readonly captureStackTrace?: boolean | LazyArg<string | undefined> | undefined
}
Added in v3.1.0
SpanStatus (type alias)
Signature
export type SpanStatus =
| {
_tag: "Started"
startTime: bigint
}
| {
_tag: "Ended"
startTime: bigint
endTime: bigint
exit: Exit.Exit<unknown, unknown>
}
Added in v2.0.0
tags
ParentSpan
Signature
export declare const ParentSpan: Context.Tag<ParentSpan, AnySpan>
Added in v2.0.0
ParentSpan (interface)
Signature
export interface ParentSpan {
readonly _: unique symbol
}
Added in v2.0.0
Tracer
Signature
export declare const Tracer: Context.Tag<Tracer, Tracer>
Added in v2.0.0
utils
Tracer (interface)
Signature
export interface Tracer {
readonly [TracerTypeId]: TracerTypeId
span(
name: string,
parent: Option.Option<AnySpan>,
context: Context.Context<never>,
links: ReadonlyArray<SpanLink>,
startTime: bigint,
kind: SpanKind
): Span
context<X>(f: () => X, fiber: Fiber.RuntimeFiber<any, any>): X
}
Added in v2.0.0
TracerTypeId
Signature
export declare const TracerTypeId: typeof TracerTypeId
Added in v2.0.0
TracerTypeId (type alias)
Signature
export type TracerTypeId = typeof TracerTypeId
Added in v2.0.0