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 spans;
31
32// Re-export tracing macros for convenience
33pub use tracing::{debug, error, info, instrument, trace, warn, Span};
34
35// Re-export span helpers
36pub use spans::*;
37
38// Re-export init functions
39pub use init::{init_telemetry, init_with_otlp, shutdown_telemetry};
40
41// Re-export metrics
42pub use opentelemetry::global;
43pub use opentelemetry::metrics::{Meter, MeterProvider};