Skip to main content

feagi_observability/
lib.rs

1// Copyright 2025 Neuraville Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4//! # feagi-observability
5//!
6//! Unified observability infrastructure for FEAGI (logging, telemetry, profiling).
7//!
8//! Provides consistent observability patterns across all FEAGI crates with
9//! per-crate debug flag support.
10//!
11//! ## Features
12//! - `file-logging`: File-based log rotation (desktop only)
13//! - `metrics`: Prometheus metrics collection (desktop only)
14//! - `opentelemetry`: OpenTelemetry exporter support
15//! - `profiling`: Chrome tracing and pprof profiling support
16
17/// Crate version from Cargo.toml
18pub const VERSION: &str = env!("CARGO_PKG_VERSION");
19
20pub mod cli;
21pub mod config;
22pub mod init;
23pub mod ring_layer;
24
25// Placeholder modules - to be implemented
26pub mod context {
27    //! Correlation IDs and context propagation
28    // TODO: Implement
29}
30
31pub mod errors {
32    //! Error handling and reporting
33    // TODO: Implement
34}
35
36pub mod logging {
37    //! Structured logging with spans
38    // TODO: Implement
39}
40
41pub mod metrics {
42    //! Prometheus metrics
43    // TODO: Implement
44}
45
46pub mod profiling {
47    //! CPU/Memory profiling
48    // TODO: Implement
49}
50
51pub mod telemetry {
52    //! Unified telemetry collection
53    // TODO: Implement
54}
55
56pub mod tracing {
57    //! Distributed tracing (OpenTelemetry)
58    // TODO: Implement
59}
60
61// Re-export commonly used items
62pub use cli::*;
63pub use config::*;
64pub use init::*;
65pub use ring_layer::{
66    capacity_from_env, global_ring, install_global_ring, LogRecord, LogRingBuffer, RingBufferLayer,
67    CAPACITY_ENV_VAR, DEFAULT_CAPACITY,
68};
69
70/// Known FEAGI crate names for debug flags
71pub const KNOWN_CRATES: &[&str] = &[
72    "feagi-api",
73    "feagi-burst-engine",
74    "feagi-bdu",
75    "feagi-services",
76    "feagi-evo",
77    "feagi-config",
78    "feagi-io",
79    "feagi-transports",
80    "feagi-agent-sdk",
81    "feagi-state-manager",
82    "feagi-plasticity",
83    "feagi-connectome-serialization",
84];