Event Recorder Interceptor
Saves raw events to disk organized by session for detailed analysis and debugging.
Configuration Options
Section titled “Configuration Options”- type: "event_recorder" enabled: true config: output_dir: "./event_logs" # Directory to save files (default: "./event_logs") file_format: "jsonl" # Format: "json" or "jsonl" (default: "jsonl") pretty_print: false # Pretty-print JSON for "json" format (default: false) include_metadata: true # Include file metadata (default: true)Configuration Reference
Section titled “Configuration Reference”| Option | Type | Default | Description |
|---|---|---|---|
output_dir | string | "./event_logs" | Directory path for saving event files |
file_format | string | "jsonl" | File format: "json" or "jsonl" |
pretty_print | boolean | false | Pretty-print JSON (only for "json" format) |
include_metadata | boolean | true | Include file metadata header |
File Formats
Section titled “File Formats”JSONL Format (Recommended):
- One event per line
- Easier for streaming processing
- Better for large sessions
- Example:
session_a1b2c3d4.jsonl
JSON Format:
- Complete session data in structured format
- Better for small sessions
- Easier to read manually
- Example:
session_a1b2c3d4.json
Output Structure
Section titled “Output Structure”event_logs/├── session_a1b2c3d4e5f6.jsonl├── session_g7h8i9j0k1l2.jsonl└── session_m3n4o5p6q7r8.jsonJSONL Example Content
Section titled “JSONL Example Content”{"_metadata": {"format": "jsonl", "session_id": "a1b2c3d4", "created_at": "2024-01-15T14:30:25", "interceptor": "event_recorder"}}{"name": "session.start", "session_id": "a1b2c3d4", "timestamp": "2024-01-15T14:30:25.123Z", "attributes": {...}}{"name": "llm.call.start", "session_id": "a1b2c3d4", "timestamp": "2024-01-15T14:30:25.456Z", "attributes": {...}}{"name": "llm.call.finish", "session_id": "a1b2c3d4", "timestamp": "2024-01-15T14:30:26.789Z", "attributes": {...}}