oxigdal_observability/lib.rs
1//! OpenTelemetry-based observability, monitoring, and alerting for OxiGDAL.
2//!
3//! This crate provides comprehensive observability capabilities for the OxiGDAL
4//! geospatial data processing library, including:
5//!
6//! - **OpenTelemetry Integration**: Distributed tracing, metrics, and logs
7//! - **Custom Geospatial Metrics**: Raster, vector, I/O, cache, query, GPU, and cluster metrics
8//! - **Distributed Tracing**: W3C Trace Context propagation across services
9//! - **Real-time Dashboards**: Grafana and Prometheus dashboard templates
10//! - **Anomaly Detection**: Statistical and ML-based anomaly detection
11//! - **SLO/SLA Monitoring**: Service level objectives and error budget tracking
12//! - **Alert Management**: Rule-based alerting with routing and escalation
13//! - **Metric Exporters**: Prometheus, StatsD, InfluxDB, CloudWatch support
14//!
15//! # Example
16//!
17//! ```no_run
18//! use oxigdal_observability::telemetry::{TelemetryConfig, init_with_config};
19//!
20//! # tokio_test::block_on(async {
21//! // Initialize telemetry
22//! let config = TelemetryConfig::new("oxigdal")
23//! .with_service_version("1.0.0")
24//! .with_jaeger_endpoint("localhost:6831")
25//! .with_sampling_rate(0.1);
26//!
27//! let provider = init_with_config(config).await.expect("Failed to initialize telemetry");
28//! # })
29//! ```
30
31#![warn(missing_docs)]
32#![allow(clippy::unwrap_used)]
33#![allow(clippy::panic)]
34
35pub mod alerting;
36pub mod anomaly;
37pub mod config;
38pub mod correlation;
39pub mod dashboard;
40pub mod dashboards;
41pub mod error;
42pub mod exporters;
43pub mod health;
44pub mod integration;
45pub mod metrics;
46pub mod profiling;
47pub mod reporting;
48pub mod slo;
49pub mod telemetry;
50pub mod tracing;
51
52// Re-export commonly used types
53pub use error::{ObservabilityError, Result};
54pub use health::{HealthCheckManager, HealthStatus};
55pub use profiling::{ProfileStats, Profiler};
56pub use telemetry::{TelemetryConfig, TelemetryProvider};
57
58#[cfg(test)]
59mod tests {
60 use super::*;
61
62 #[test]
63 fn test_telemetry_config() {
64 let config = TelemetryConfig::new("test-service")
65 .with_service_version("1.0.0")
66 .with_sampling_rate(0.5);
67
68 assert_eq!(config.service_name, "test-service");
69 assert_eq!(config.service_version, "1.0.0");
70 assert_eq!(config.sampling_rate, 0.5);
71 }
72}