adk_telemetry/
lib.rs

1//! # ADK Telemetry
2//!
3//! Production-grade observability for ADK using structured logging and distributed tracing.
4//!
5//! ## Features
6//! - Structured logging with `tracing`
7//! - OpenTelemetry integration for distributed tracing
8//! - OTLP export for observability backends (Jaeger, Datadog, etc.)
9//! - Automatic context propagation
10//!
11//! ## Usage
12//!
13//! ```rust
14//! use adk_telemetry::{init_telemetry, info, instrument};
15//!
16//! fn main() -> Result<(), Box<dyn std::error::Error>> {
17//!     // Initialize telemetry in your main
18//!     init_telemetry("my-service")?;
19//!
20//!     // Use logging macros
21//!     #[instrument]
22//!     async fn my_function() {
23//!         info!("Function called");
24//!     }
25//!     Ok(())
26//! }
27//! ```
28
29pub mod init;
30pub mod span_exporter;
31pub mod spans;
32
33// Re-export tracing macros for convenience
34pub use tracing::{Span, debug, error, info, instrument, trace, warn};
35
36// Re-export span helpers
37pub use spans::*;
38
39// Re-export span exporter (ADK-Go style)
40pub use span_exporter::*;
41
42// Re-export init functions
43pub use init::{init_telemetry, init_with_adk_exporter, init_with_otlp, shutdown_telemetry};
44
45// Re-export metrics
46pub use opentelemetry::global;
47pub use opentelemetry::metrics::{Meter, MeterProvider};