Skip to main content
These recipes cover the core tracing patterns. For conceptual background, see Observability & Tracing.

Setup


Decorator Pattern

Wrap existing functions without modifying their internals. Input/output are captured automatically.

Context Manager Pattern

Automatic lifecycle management with explicit control over span attributes.

Manual Spans

Full control over span creation, nesting, and lifecycle.

Add User & Session Context

Track users and group related traces into sessions.

Observation Types

Use specific types for better categorization in the ABV UI.

Error Handling

Capture errors with appropriate log levels.

Get Trace URL

Share traces by getting the direct URL.

Gateway Patterns

Next: Multi-provider LLM routing

Data Model

Reference: Traces, spans, and observations