/** * Observability Tracing * * @module observability/tracing */ import type { RuntimeAdapter } from "../../platform/adapters/base.js"; import { tracingManager } from "./manager.js"; import type { Context, Span, SpanOptions, TracingConfig } from "./types.js"; export type { Context, Span, SpanOptions, TracingConfig } from "./types.js"; export { loadConfig } from "./config.js"; export { SpanOperations } from "./span-operations.js"; export { ContextPropagation } from "./context-propagation.js"; export { SpanNames } from "./span-names.js"; /** Initialize tracing for the current runtime. */ export declare function initTracing(config?: Partial, adapter?: RuntimeAdapter): Promise; /** Check whether tracing is enabled. */ export declare function isTracingEnabled(): boolean; export declare function isTracingDegraded(): boolean; /** Shut down the tracing runtime. */ export declare function shutdownTracing(): void; export declare function getTracingState(): ReturnType; /** Starts span. */ export declare function startSpan(name: string, options?: SpanOptions): Span | null; /** End an active tracing span. */ export declare function endSpan(span: Span | null, ...failure: [] | [error: unknown]): void; /** Sets span attributes. */ export declare function setSpanAttributes(span: Span | null, attributes: Record): void; /** Event emitted for add span. */ export declare function addSpanEvent(span: Span | null, name: string, attributes?: Record): void; /** Create child span. */ export declare function createChildSpan(parentSpan: Span | null, name: string, options?: SpanOptions): Span | null; /** Context for extract. */ export declare function extractContext(headers: Headers): Context | undefined; /** Context for inject. */ export declare function injectContext(context: Context, headers: Headers): void; /** Context for get active. */ export declare function getActiveContext(): Context | undefined; /** Applies active span. */ export declare function withActiveSpan(span: Span | null, fn: () => Promise): Promise; /** Applies span. */ export declare function withSpan(name: string, fn: (span: Span | null) => Promise, options?: SpanOptions): Promise; /** Applies span sync. */ export declare function withSpanSync(name: string, fn: (span: Span | null) => T, options?: SpanOptions): T; export { tracingManager } from "./manager.js"; export { TracingManager } from "./manager.js"; //# sourceMappingURL=index.d.ts.map