init_with_otlp

Function init_with_otlp 

Source
pub fn init_with_otlp(
    service_name: &str,
    endpoint: &str,
) -> Result<(), Box<dyn Error>>
Available on crate feature telemetry only.
Expand description

Initialize telemetry with OpenTelemetry OTLP export

Enables distributed tracing by exporting spans to an OTLP collector.

§Arguments

  • service_name - Name of the service for trace identification
  • endpoint - OTLP collector endpoint (e.g., “http://localhost:4317”)

§Example

use adk_telemetry::init_with_otlp;
init_with_otlp("my-agent", "http://localhost:4317")
    .expect("Failed to initialize telemetry");