Observer Trait
Corvus uses the Observer trait for pluggable observability backends. All agent events flow through observers:- Log — Structured logging to stdout/stderr
- Prometheus — Metrics for Prometheus scraping
- OpenTelemetry — OTLP traces and metrics
- Noop — No-op observer (disabled)
- Multi — Combine multiple observers
Configuration
Basic Setup
Logging
Structured logging to stdout:Prometheus Metrics
Enable Prometheus backend:corvus_tool_executions_total— Total tool executionscorvus_tool_duration_seconds— Tool execution durationcorvus_provider_requests_total— LLM API requestscorvus_provider_errors_total— LLM API errorscorvus_memory_operations_total— Memory store/recall/forgetcorvus_channel_messages_total— Messages sent/received per channel
OpenTelemetry (OTLP)
Enable OpenTelemetry backend:- OTLP HTTP (port 4318, default)
- OTLP gRPC (port 4317)
Multiple Observers
Combine log + prometheus:Observer Events
All agent activity generatesObserverEvent instances:
Event Redaction
Sensitive data is automatically redacted from observer events:- API keys
- Bearer tokens
- File contents (only paths logged)
- User messages (redacted in logs, available in traces)
Logging Configuration
Environment Variables
Log level:Log Formats
Compact (default):Metrics (Prometheus)
Metric Types
Counters:corvus_tool_executions_total{tool="file_read"}corvus_provider_requests_total{provider="openrouter"}
corvus_tool_duration_seconds_bucket{tool="shell"}corvus_provider_latency_seconds_bucket{provider="openai"}
corvus_active_channels{channel="telegram"}corvus_memory_entries_total
Grafana Dashboard
Import dashboard:Alerting Rules
alerts.yml:
OpenTelemetry Tracing
Trace Structure
Agent loop trace:Span Attributes
Standard attributes:service.name— “corvus-agent”agent.autonomy_level— “supervised”agent.workspace_dir— “/home/user/project”
tool.name— Tool identifiertool.duration— Execution timetool.success— true/false
provider.name— Provider identifierprovider.model— Model nameprovider.latency— Response timeprovider.tokens— Token usage
Distributed Tracing
Propagate trace context via webhooks:Health Checks
Gateway Health Endpoint
System Diagnostics
Performance Monitoring
Startup Time
Memory Footprint
Tool Execution Time
Via metrics:- View in Jaeger UI
- Filter by
tool.name - Analyze P50/P95/P99 latencies
Troubleshooting
Enable Verbose Logging
Debug Specific Modules
Capture Full Traces
Best Practices
- Production: Use
backend = "otel"with centralized collector - Development: Use
backend = "log"withRUST_LOG=debug - Monitoring: Use
backend = "prometheus"+ Grafana dashboards - Debugging: Use
backend = "multi"with log + otel
Next Steps
Deployment
Production deployment guide
Troubleshooting
Common issues and solutions