import { SpanProcessor } from "@opentelemetry/sdk-trace-base"; import { TraceConfig } from "@pydantic/otel-cf-workers"; import { Level, LogfireAttributeScrubber, NoopAttributeScrubber, ScrubbingOptions, ULIDGenerator, configureLogfireApi, debug, error, fatal, info, log, logfireApiConfig, notice, reportError, resolveBaseUrl, resolveSendToLogfire, serializeAttributes, span, startPendingSpan, startSpan, trace, warning, withSettings, withTags } from "logfire"; //#region src/exportTailEventsToLogfire.d.ts interface TraceItem { logs: { message: unknown[]; }[]; } declare function exportTailEventsToLogfire(events: TraceItem[], env: Record): Promise; //#endregion //#region src/index.d.ts type Env = unknown; type DOClass = new (state: DurableObjectState, env: Env) => DurableObject; type ConfigOptionsBase = Pick; interface InProcessConfigOptions extends ConfigOptionsBase { /** * Additional span processors to add to the tracer provider. */ additionalSpanProcessors?: SpanProcessor[]; baseUrl?: string; /** * Whether to log the spans to the console in addition to sending them to the Logfire API. */ console?: boolean; /** * Options for scrubbing sensitive data. Set to False to disable. */ scrubbing?: false | ScrubbingOptions; } interface TailConfigOptions extends ConfigOptionsBase {} declare function getTailConfig(config: TailConfigOptions): (env: Env) => TraceConfig; declare function instrumentInProcess(handler: T, config: InProcessConfigOptions): T; declare function instrumentDO = DOClass>(doClass: T, config: InProcessConfigOptions): T; declare function instrumentTail(handler: T, config: TailConfigOptions): T; /** * Alias for `instrumentInProcess` to maintain compatibility with previous versions. */ declare const instrument: typeof instrumentInProcess; declare const defaultExport: { exportTailEventsToLogfire: typeof exportTailEventsToLogfire; Level: typeof Level; LogfireAttributeScrubber: typeof LogfireAttributeScrubber; NoopAttributeScrubber: typeof NoopAttributeScrubber; ULIDGenerator: typeof ULIDGenerator; configureLogfireApi: typeof configureLogfireApi; debug: typeof debug; error: typeof error; fatal: typeof fatal; getTailConfig: typeof getTailConfig; info: typeof info; instrument: typeof instrument; instrumentDO: typeof instrumentDO; instrumentInProcess: typeof instrumentInProcess; instrumentTail: typeof instrumentTail; log: typeof log; logfireApiConfig: typeof logfireApiConfig; notice: typeof notice; reportError: typeof reportError; resolveBaseUrl: typeof resolveBaseUrl; resolveSendToLogfire: typeof resolveSendToLogfire; serializeAttributes: typeof serializeAttributes; span: typeof span; startPendingSpan: typeof startPendingSpan; startSpan: typeof startSpan; trace: typeof trace; warning: typeof warning; withSettings: typeof withSettings; withTags: typeof withTags; }; //#endregion export { InProcessConfigOptions, TailConfigOptions, TraceItem, defaultExport as default, exportTailEventsToLogfire, getTailConfig, instrument, instrumentDO, instrumentInProcess, instrumentTail };