How Log Levels Work
ABV supports four log levels to categorize observations by severity:- DEBUG: Verbose internal details (tool calls, intermediate steps, debugging info)
- DEFAULT: Standard operations (successful LLM calls, normal workflow steps)
- WARNING: Degraded performance or unexpected behavior (slow responses, fallbacks, retries)
- ERROR: Failures (API errors, timeouts, invalid outputs, exceptions)
Understand Log Level Hierarchy
- Internal tool executions
- Intermediate processing steps
- Variable values for debugging
- Cache hits/misses
- Retry attempts before failure
- Successful LLM API calls
- Standard workflow completions
- User interactions without issues
- Expected behavior
- Slow LLM responses (>5 seconds)
- Fallback to alternative model/prompt
- Deprecated feature usage
- Rate limit warnings (approaching threshold)
- Validation warnings (non-blocking)
- LLM API errors (401, 500, timeouts)
- Exceptions and crashes
- Invalid outputs (failed parsing, guardrail violations)
- Data processing failures
- Critical validation failures
Set Log Levels on Observations
Add Status Messages for Context
statusMessage alongside the log level to provide human-readable context about why this observation has a particular severity.Good status messages:"LLM timeout after 30 seconds"(ERROR)"Fallback to gpt-3.5-turbo due to rate limit"(WARNING)"Cache miss, fetching from API"(DEBUG)"Retry 2/3 after transient error"(WARNING)
"Error"(too generic)"Something went wrong"(not actionable)""(empty, provides no context)
Filter Traces by Log Level in Dashboard
- Production debugging: Filter to ERROR only to see all failures
- Performance optimization: Filter to WARNING to find slow or degraded operations
- Development: Show DEBUG to see full execution details
- View single trace → Filter observations by level
- Trace list view → Filter entire traces containing ERROR observations
- Search queries:
level = "ERROR"orlevel IN ["WARNING", "ERROR"]
Set Minimum Log Level for Sampling
- Development: All DEBUG, DEFAULT, WARNING, ERROR observations logged
- Production: Only WARNING and ERROR observations logged (70% cost reduction)
min_log_level, log_level, etc.).Why Use Log Levels?
Prioritize Signal Over Noise in Production
Prioritize Signal Over Noise in Production
level = "ERROR": See only failed observationslevel >= "WARNING": See concerning behavior leading to failurelevel = "ERROR" AND environment = "production": Production failures only
- Find failures in seconds instead of scrolling through hundreds of successful operations
- Eliminate noise from DEBUG logs in production
- Focus on actionable errors
Reduce Ingestion Costs by Filtering Debug Logs
Reduce Ingestion Costs by Filtering Debug Logs
Enable Smart Alerting and Monitoring
Enable Smart Alerting and Monitoring
- Alert when ERROR observations exceed 1% of total traces
- Catches systematic failures (API outage, bad prompt deployment)
- Alert when >100 ERROR observations in 5 minutes
- Catches spikes in failures
- Alert when WARNING observations exceed 10% of traces
- Catches degraded performance (slow responses, frequent retries)
- Alert on any ERROR in critical workflows (payment processing, compliance tasks)
- Catches every failure immediately
- Proactive issue detection (catch errors before users complain)
- Reduced alert fatigue (only actionable alerts)
- Faster incident response (trace URL in alert for instant debugging)
Debug Complex Workflows with Progressive Detail
Debug Complex Workflows with Progressive Detail
- Development: See every step for debugging
- Production: Only see issues (warnings, errors)
- Selective detail: Enable DEBUG for specific users or traces when investigating issues
Track Degraded Performance with Warnings
Track Degraded Performance with Warnings
- Query for WARNING observations over time
- Identify trends: Are latency warnings increasing?
- Correlate warnings with deployments or traffic spikes
Implementation Guide
Python: Using the @observe() Decorator
Python: Using the @observe() Decorator
@observe() decorator to automatically trace functions.Setup:Python: Manual Span Creation
Python: Manual Span Creation
JavaScript/TypeScript: Using Context Managers
JavaScript/TypeScript: Using Context Managers
@abvdev/tracing package.Setup:JavaScript/TypeScript: Using the observe Wrapper
JavaScript/TypeScript: Using the observe Wrapper
JavaScript/TypeScript: Manual Span Creation
JavaScript/TypeScript: Manual Span Creation