1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Tracer system for observability and debugging
//!
//! The tracer system provides comprehensive observability into LLM interactions,
//! tool executions, and agent communications. It records events with timestamps
//! and correlation IDs, enabling detailed debugging and monitoring.
//!
//! # Architecture
//!
//! The tracer system consists of several key components:
//!
//! - **TracerEvent**: Base trait for all event types with timestamps and correlation IDs
//! - **EventStore**: Thread-safe storage for events with callbacks and filtering
//! - **TracerSystem**: Coordination layer providing convenience methods for recording events
//! - **NullTracer**: Null object pattern for when tracing is disabled
//!
//! # Event Types
//!
//! - **LlmCallTracerEvent**: Records LLM calls with model, messages, temperature, and tools
//! - **LlmResponseTracerEvent**: Records LLM responses with content, tool calls, and duration
//! - **ToolCallTracerEvent**: Records tool executions with arguments, results, and duration
//! - **AgentInteractionTracerEvent**: Records agent-to-agent communications
//!
//! # Usage Example
//!
//! ```rust,ignore
//! use mojentic::tracer::{TracerSystem, LlmCallTracerEvent};
//! use std::collections::HashMap;
//!
//! // Create a tracer system
//! let tracer = TracerSystem::default();
//!
//! // Record an LLM call
//! tracer.record_llm_call(
//! "llama3.2",
//! vec![],
//! 0.7,
//! None,
//! "my_agent",
//! "correlation-123"
//! );
//!
//! // Query events
//! let events = tracer.get_events(None, None, None);
//! for event in events {
//! println!("{}", event.printable_summary());
//! }
//! ```
//!
//! # Correlation IDs
//!
//! Correlation IDs are UUIDs that are copied from cause-to-effect across the system,
//! enabling you to trace all events related to a single request or operation.
//! This creates a complete audit trail for debugging and observability.
// Re-export main types
pub use ;
pub use NullTracer;
pub use ;
pub use TracerSystem;