1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! OpenTelemetry observability module for vibesql-server
//!
//! This module provides comprehensive observability through OpenTelemetry,
//! including metrics, distributed tracing, and structured logging.
//!
//! # Features
//!
//! - **Metrics**: Connection counts, query latency, error rates
//! - **Traces**: Distributed tracing through query execution pipeline
//! - **Logs**: Structured logs correlated with traces
//!
//! # Configuration
//!
//! Observability is configured through the `[observability]` section in
//! `vibesql-server.toml`. See `config.rs` for available options.
//!
//! # Example
//!
//! ```no_run
//! use vibesql_server::observability::{ObservabilityConfig, ObservabilityProvider};
//!
//! # async fn example() -> anyhow::Result<()> {
//! let config = ObservabilityConfig::default();
//! let provider = ObservabilityProvider::init(&config)?;
//!
//! // Use metrics
//! if let Some(metrics) = provider.metrics() {
//! metrics.record_connection();
//! }
//!
//! // Shutdown cleanly
//! provider.shutdown()?;
//! # Ok(())
//! # }
//! ```
pub use ObservabilityConfig;
// Re-exported for public API
pub use ServerMetrics;
pub use ObservabilityProvider;