Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Tracer
Defined in the trace module.
Rust AI Agent SDK
Global tracer for convenience.
Fields
| Name | Type | Description |
|---|
traces | Arc<RwLock<HashMap<String | Active traces |
exporters | Arc<RwLock<Vec<Box<dyn TraceExporter>>>> | Exporters |
Methods
new
Create a new tracer.
add_exporter
fn add_exporter(&self, exporter: impl TraceExporter + 'static) -> ()
Add an exporter.
Parameters:
| Name | Type |
|---|
exporter | impl TraceExporter + 'static |
start_trace
fn start_trace(&self, name: impl Into<String>) -> String
Start a new trace.
Parameters:
| Name | Type |
|---|
name | impl Into<String> |
end_trace
fn end_trace(&self, trace_id: &str) -> ()
End a trace and export.
Parameters:
start_span
fn start_span(&self, trace_id: &str, name: impl Into<String>, kind: SpanKind) -> Option<String>
Start a span in a trace.
Parameters:
| Name | Type |
|---|
trace_id | &str |
name | impl Into<String> |
kind | SpanKind |
end_span
fn end_span(&self, trace_id: &str, span_id: &str) -> ()
End a span in a trace.
Parameters:
| Name | Type |
|---|
trace_id | &str |
span_id | &str |
trace_count
fn trace_count(&self) -> usize
Get trace count.
Source
View on GitHub
praisonai/src/trace/mod.rs at line 382