Skip to main content

Crate adk_telemetry

Crate adk_telemetry 

Source
Expand description

§ADK Telemetry

Production-grade observability for ADK using structured logging and distributed tracing.

§Features

  • Structured logging with tracing
  • OpenTelemetry integration for distributed tracing
  • OTLP export for observability backends (Jaeger, Datadog, etc.)
  • Automatic context propagation
  • OTel GenAI Semantic Conventions (v1.41.0) via genai-semconv feature (enabled by default)

§Usage

use adk_telemetry::{init_telemetry, info, instrument};

fn main() -> Result<(), adk_telemetry::TelemetryError> {
    // Initialize telemetry in your main
    init_telemetry("my-service")?;

    // Use logging macros
    #[instrument]
    async fn my_function() {
        info!("Function called");
    }
    Ok(())
}

Re-exports§

pub use init::TelemetryError;
pub use init::init_telemetry;
pub use init::init_with_adk_exporter;
pub use init::shutdown_telemetry;
pub use semconv::GenAiOperation;
pub use semconv::GenAiProvider;
pub use semconv::GenAiResponseRecorder;
pub use semconv::GenAiSpanBuilder;
pub use spans::*;
pub use span_exporter::*;

Modules§

config
Runtime configuration for semantic convention emission.
events
Content event emitter for opt-in prompt/completion capture.
init
Telemetry initialization and configuration
instrument
Attach a span to a std::future::Future.
semconv
OpenTelemetry GenAI Semantic Convention attribute constants and helpers.
span_exporter
spans
Span helpers for common ADK operations

Macros§

debug
Constructs an event at the debug level.
error
Constructs an event at the error level.
info
Constructs an event at the info level.
trace
Constructs an event at the trace level.
warn
Constructs an event at the warn level.

Structs§

Span
A handle representing a span, with the capability to enter the span if it exists.

Attribute Macros§

instrument
Instruments a function to create and enter a tracing span every time the function is called.