TraceContext
Defined in the trace module.Rust AI Agent SDK Context for a trace.
Fields
| Name | Type | Description |
|---|---|---|
id | String | Trace ID |
name | String | Trace name |
start_time | Instant | Start time |
spans | Vec<Span> | All spans |
span_stack | Vec<String> | Current span stack |
attributes | HashMap<String | Attributes |
serde_json | :Value> | Attributes |
Methods
new
| Name | Type |
|---|---|
name | impl Into<String> |
elapsed
start_span
| Name | Type |
|---|---|
name | impl Into<String> |
kind | SpanKind |
end_span
| Name | Type |
|---|---|
span_id | &str |
current_span_id
get_span
| Name | Type |
|---|---|
span_id | &str |
get_span_mut
| Name | Type |
|---|---|
span_id | &str |
add_event
| Name | Type |
|---|---|
name | impl Into<String> |
set_attribute
| Name | Type |
|---|---|
key | impl Into<String> |
value | impl Serialize |
spans
span_count
Source
View on GitHub
praisonai/src/trace/mod.rs at line 207
