Skip to main content

trace

Rust AI Agent SDK Trace Module for PraisonAI Rust SDK. Provides tracing and observability for agent execution.

Example

use praisonai::trace::{TraceContext, Span, SpanKind};

let mut ctx = TraceContext::new("my-trace");
let span = ctx.start_span("agent-execution", SpanKind::Internal);
// ... do work ...
ctx.end_span(span);

Import

use praisonai::trace::*;

Classes

Span

A span representing a unit of work.

SpanEvent

An event within a span.

TraceContext

Context for a trace.

ConsoleExporter

Console exporter (prints to stdout).

JsonFileExporter

JSON file exporter.

Tracer

Global tracer for convenience.

ContextEvent

A context event for replay/debugging.

ContextNoOpSink

No-op sink (does nothing, zero overhead).

ContextListSink

List sink (stores events in memory).

ContextTraceEmitter

Context trace emitter.

TraceExporter

Trait for trace exporters.

ContextTraceSinkProtocol

Protocol trait for context trace sinks.

SpanKind

Kind of span.

SpanStatus

Status of a span.

ContextEventType

Type of context event.

Rust Tracing

Rust Telemetry