Tracer.ts overview
Since v2.0.0
Exports Grouped by Category
annotations
DisablePropagation
Signature
declare const DisablePropagation: Context.Reference<DisablePropagation, boolean>
Since v3.12.0
DisablePropagation (interface)
Signature
export interface DisablePropagation {
readonly _: unique symbol
}
Since v3.12.0
constructors
externalSpan
Signature
declare const externalSpan: (options: {
readonly spanId: string
readonly traceId: string
readonly sampled?: boolean | undefined
readonly context?: Context.Context<never> | undefined
}) => ExternalSpan
Since v2.0.0
make
Signature
declare const make: (options: Omit<Tracer, typeof TracerTypeId>) => Tracer
Since v2.0.0
tracerWith
Signature
declare const tracerWith: <A, E, R>(f: (tracer: Tracer) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
Since v2.0.0
models
AnySpan (type alias)
Signature
type AnySpan = Span | ExternalSpan
Since 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>
}
Since 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
addLinks(links: ReadonlyArray<SpanLink>): void
}
Since v2.0.0
SpanKind (type alias)
Signature
type SpanKind = "internal" | "server" | "client" | "producer" | "consumer"
Since v3.1.0
SpanLink (interface)
Signature
export interface SpanLink {
readonly _tag: "SpanLink"
readonly span: AnySpan
readonly attributes: Readonly<Record<string, unknown>>
}
Since 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
}
Since v3.1.0
SpanStatus (type alias)
Signature
type SpanStatus =
| {
_tag: "Started"
startTime: bigint
}
| {
_tag: "Ended"
startTime: bigint
endTime: bigint
exit: Exit.Exit<unknown, unknown>
}
Since v2.0.0
tags
ParentSpan
Signature
declare const ParentSpan: Context.Tag<ParentSpan, AnySpan>
Since v2.0.0
ParentSpan (interface)
Signature
export interface ParentSpan {
readonly _: unique symbol
}
Since v2.0.0
Tracer
Signature
declare const Tracer: Context.Tag<Tracer, Tracer>
Since 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
}
Since v2.0.0
TracerTypeId
Signature
declare const TracerTypeId: unique symbol
Since v2.0.0
TracerTypeId (type alias)
Signature
type TracerTypeId = typeof TracerTypeId
Since v2.0.0