adk-telemetry
OpenTelemetry integration for Rust Agent Development Kit (ADK-Rust) agent observability.
Overview
adk-telemetry provides observability infrastructure for the Rust Agent Development Kit (ADK-Rust), including:
- Tracing - Distributed tracing with OpenTelemetry
- Logging - Structured logging with tracing-subscriber
- Metrics - Performance metrics export
- Span Context - Propagation across agent boundaries
Installation
[]
= "0.2.0"
Or use the meta-crate:
[]
= { = "0.2.1", = ["telemetry"] }
Quick Start
use init_telemetry;
Configuration
Set the RUST_LOG environment variable:
# Debug logging for ADK
RUST_LOG=adk=debug
# Trace level for specific modules
RUST_LOG=adk_agent=trace,adk_model=debug
OpenTelemetry Export
Configure OTLP export for distributed tracing:
use init_with_otlp;
Available Functions
| Function | Description |
|---|---|
init_telemetry(service_name) |
Basic console logging |
init_with_otlp(service_name, endpoint) |
OTLP export to collectors |
init_with_adk_exporter(service_name) |
ADK-style span exporter |
shutdown_telemetry() |
Flush and shutdown |
Re-exports
Convenience re-exports from tracing:
use ;
Features
- Zero-config defaults with sensible logging
- OpenTelemetry-compatible span export
- Automatic context propagation
- JSON or pretty-print log formats
Related Crates
License
Apache-2.0
Part of ADK-Rust
This crate is part of the ADK-Rust framework for building AI agents in Rust.