/** * @since 1.0.0 */ import type * as Context from "@effect/data/Context"; import type * as Option from "@effect/data/Option"; import type * as Effect from "@effect/io/Effect"; import type * as Exit from "@effect/io/Exit"; import type * as Fiber from "@effect/io/Fiber"; /** * @since 1.0.0 */ export declare const TracerTypeId: unique symbol; /** * @since 1.0.0 */ export type TracerTypeId = typeof TracerTypeId; /** * @since 1.0.0 */ export interface Tracer { readonly [TracerTypeId]: TracerTypeId; readonly span: (name: string, parent: Option.Option, context: Context.Context, links: ReadonlyArray, startTime: bigint) => Span; readonly context: (f: () => X, fiber: Fiber.RuntimeFiber) => X; } /** * @since 1.0.0 * @category models */ export type SpanStatus = { _tag: "Started"; startTime: bigint; } | { _tag: "Ended"; startTime: bigint; endTime: bigint; exit: Exit.Exit; }; /** * @since 1.0.0 * @category models */ export type ParentSpan = Span | ExternalSpan; /** * @since 1.0.0 * @category models */ export interface ExternalSpan { readonly _tag: "ExternalSpan"; readonly spanId: string; readonly traceId: string; readonly context: Context.Context; } /** * @since 1.0.0 * @category models */ export interface Span { readonly _tag: "Span"; readonly name: string; readonly spanId: string; readonly traceId: string; readonly parent: Option.Option; readonly context: Context.Context; readonly status: SpanStatus; readonly attributes: ReadonlyMap; readonly links: ReadonlyArray; readonly end: (endTime: bigint, exit: Exit.Exit) => void; readonly attribute: (key: string, value: AttributeValue) => void; readonly event: (name: string, startTime: bigint, attributes?: Record) => void; } /** * @since 1.0.0 * @category models */ export type AttributeValue = string | boolean | number; /** * @since 1.0.0 * @category models */ export interface SpanLink { readonly _tag: "SpanLink"; readonly span: ParentSpan; readonly attributes: Readonly>; } /** * @since 1.0.0 * @category tags */ export declare const Tracer: Context.Tag; /** * @since 1.0.0 * @category constructors */ export declare const make: (options: Omit) => Tracer; /** * @since 1.0.0 * @category constructors */ export declare const tracerWith: (f: (tracer: Tracer) => Effect.Effect) => Effect.Effect; //# sourceMappingURL=Tracer.d.ts.map