Quick Start
1
Create Your Sink
Implement 3 methods:
emit(), flush(), close()2
Connect to Agent
Use
trace_context() to capture all agent eventsHow It Works
The Protocol
Your sink must implement 3 methods. That’s it!
- Protocol
- Methods
ContextTraceSink is a backward-compatible alias for ContextTraceSinkProtocol.Example Sinks
HTTP Sink
HTTP Sink
Send events to a remote HTTP endpoint with batching.
Database Sink
Database Sink
Store events in SQLite database for later analysis.
Console Sink
Console Sink
Print events to console for debugging.
Event Types
Event Data
Architecture
Best Practices
Buffer Events
Batch events before sending to reduce network calls
Handle Errors
Sink errors are caught silently - tracing never crashes agents
Use trace_context
Automatic cleanup even if exceptions occur
Thread Safety
Use locks if your sink is accessed from multiple threads
Zero Overhead
When tracing is disabled, there’s zero performance impact:API Reference
ContextTraceEmitter
trace_context
Built-in Sinks
CLI Commands
Use the CLI to manage traces:Related
Context Replay
Debug agent execution step-by-step
Observability
20+ provider integrations
Observability Hooks — Third-party sink plugins
Register sinks via the
praisonai.observability_sinks entry-point group
