Skip to main content

Module telemetry

Module telemetry 

Source
Available on crate feature telemetry only.
Expand description

Telemetry (OpenTelemetry integration).

Production observability:

  • Distributed tracing
  • Metrics collection
  • Log correlation

Available with feature: telemetry

Modules§

global
Utilities for working with global telemetry primitives
init
Telemetry initialization and configuration
instrument
Attach a span to a std::future::Future.
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§

AdkSpanExporter
ADK-Go style span exporter that stores spans by event_id Follows the pattern from APIServerSpanExporter in ADK-Go
AdkSpanLayer
Tracing layer that captures spans and exports them via AdkSpanExporter
LlmUsage
Token usage data for recording on tracing spans.
Meter
Provides the ability to create instruments for recording measurements or accepting callbacks to report measurements.
Span
A handle representing a span, with the capability to enter the span if it exists.

Enums§

TelemetryError
Error returned by telemetry initialization functions.

Traits§

MeterProvider
Provides access to named Meter instances, for instrumenting an application or crate.

Functions§

add_context_attributes
Add common attributes to the current span
agent_run_span
Create a span for agent execution
build_otlp_layer
Build an OTLP tracing layer without initializing a global subscriber.
callback_span
Create a span for callback execution
init_telemetry
Initialize basic telemetry with console logging.
init_with_adk_exporter
Initialize telemetry with ADK span exporter.
init_with_otlp
Initialize telemetry with OpenTelemetry OTLP export.
llm_generate_span
Create a span for LLM generate_content calls with pre-declared token usage fields.
model_call_span
Create a span for model API calls
record_llm_usage
Record LLM token usage on the current span.
shutdown_telemetry
Shutdown telemetry and flush any pending spans.
tool_execute_span
Create a span for tool execution

Attribute Macros§

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