feagi-observability
Standardized logging, error handling, metrics, and tracing infrastructure for FEAGI.
Purpose
This crate provides a single source of truth for all observability concerns across FEAGI crates. All crates MUST use this crate instead of directly depending on tracing, log, anyhow, etc.
Usage
Logging
use ;
// Structured logging with consistent fields
burst_info!;
api_info!;
feagi_error!;
Errors
use ;
Metrics
use *;
BURST_COUNT.inc;
let _timer = BURST_DURATION.start_timer;
// ... burst logic
Tracing
use ;
init_tracing?;
Structure
feagi-observability/
├── Cargo.toml
├── README.md
└── src/
├── lib.rs # Re-exports
├── logging.rs # Standardized logging macros
├── errors.rs # Error types and context
├── metrics.rs # Prometheus metrics
├── tracing.rs # Tracing initialization
└── debug.rs # Debugging utilities
Dependencies
[]
= "0.1"
= { = "0.3", = ["env-filter", "json"] }
= "1.0"
= "1.0"
= "0.13"
= "0.4"
= { = "1.0", = ["derive"] }
[]
= []
= ["opentelemetry", "opentelemetry-sdk", "opentelemetry-otlp", "tracing-opentelemetry"]
Benefits
- Consistency: All crates use same logging patterns
- Maintainability: Single place to update observability behavior
- Enforcement: Can check for direct
tracing::*!usage in CI - Evolution: Easy to add new logging patterns/metrics