Observability & Resilience (maticlib.observability & maticlib.resilience)
Tracing
Easily log execution time, token usage, and errors across the entire lifecycle.
from maticlib.observability.trace import PipelineTrace
from maticlib.observability.callbacks import LoggingCallbackHandler
trace = PipelineTrace(pipeline_name="My_RAG")
handler = LoggingCallbackHandler()
handler.on_pipeline_start(trace)
# ... run steps ...
handler.on_pipeline_end(trace)
Retry Policies
Handle flaky external LLM APIs with robust, exponential backoff.
- Use RetryPolicy manually or the @with_retry(max_retries=3) decorator on any function.