Skip to content

Event Recorder Interceptor

Saves raw events to disk organized by session for detailed analysis and debugging.

- 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)
OptionTypeDefaultDescription
output_dirstring"./event_logs"Directory path for saving event files
file_formatstring"jsonl"File format: "json" or "jsonl"
pretty_printbooleanfalsePretty-print JSON (only for "json" format)
include_metadatabooleantrueInclude file metadata header

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
event_logs/
├── session_a1b2c3d4e5f6.jsonl
├── session_g7h8i9j0k1l2.jsonl
└── session_m3n4o5p6q7r8.json
{"_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": {...}}