/** * Observability Module - Unified tracing, logging, and metrics * * Delivery status, as of this version: * * - Langfuse - delivers, via the optional `langfuse` SDK. `isEnabled` is true * only once initialize() has built a client from that SDK. * - console - prints traces locally (built-in). * - memory - keeps traces in process (built-in). * - noop - discards everything, and says so (`isEnabled === false`). * * LangSmith, LangWatch, Arize, Axiom, Braintrust, Helicone, Laminar, Maxim, * Patronus, Scorecard, SigNoz, Traceloop and Weave have adapter shells but NO * delivery: they record spans in memory and send nothing to the vendor. They * report `isEnabled === false`, warn on construction, and warn again on * flush(). Do not rely on them to get traces off the machine. See * `adapters/external/undelivered.ts`. * * @example Basic usage * ```typescript * import { createObservabilityAdapter, setObservabilityAdapter } from 'praisonai'; * * // Enable observability. Always check isEnabled: an adapter with no delivery * // implementation reports false and will not send your traces anywhere. * const adapter = await createObservabilityAdapter('langfuse'); * if (!adapter.isEnabled) { * console.warn('traces will stay in memory only'); * } * setObservabilityAdapter(adapter); * * // Use with agents * const agent = new Agent({ * instructions: "You are helpful" * }); * ``` */ export type { SpanKind, SpanStatus, SpanData, SpanEvent, TraceData, TraceContext, SpanContext, ObservabilityAdapter, AttributionContext, ProviderMetadata, ObservabilityToolConfig, ObservabilityToolName, ObservabilityToolInfo } from './types'; export { OBSERVABILITY_TOOLS, getObservabilityToolInfo, listObservabilityTools, hasObservabilityToolEnvVar } from './types'; export { NoopObservabilityAdapter, noopAdapter, MemoryObservabilityAdapter, createMemoryAdapter, ConsoleObservabilityAdapter, createConsoleAdapter, createObservabilityAdapter, clearAdapterCache } from './adapters'; import type { ObservabilityAdapter } from './types'; /** * Set the global observability adapter */ export declare function setObservabilityAdapter(adapter: ObservabilityAdapter): void; /** * Get the global observability adapter (creates memory adapter if not set) */ export declare function getObservabilityAdapter(): ObservabilityAdapter; /** * Reset the global observability adapter (for testing) */ export declare function resetObservabilityAdapter(): void; /** * Create a trace helper function for easy integration */ export declare function trace(toolName?: string): { tool: string; getAdapter(): Promise; };