Span
Defined in the trace module.Rust AI Agent SDK A span representing a unit of work.
Fields
| Name | Type | Description |
|---|---|---|
id | String | Span ID |
parent_id | Option<String> | Parent span ID |
trace_id | String | Trace ID |
name | String | Span name |
kind | SpanKind | Span kind |
status | SpanStatus | Span status |
start_offset | Duration | Start time (as duration since trace start) |
end_offset | Option<Duration> | End time (as duration since trace start) |
duration | Option<Duration> | Duration |
attributes | HashMap<String | Attributes |
serde_json | :Value> | Attributes |
events | Vec<SpanEvent> | Events |
error_message | Option<String> | Error message (if status is Error) |
Methods
new
| Name | Type |
|---|---|
trace_id | impl Into<String> |
name | impl Into<String> |
kind | SpanKind |
start_offset | Duration |
with_parent
| Name | Type |
|---|---|
parent_id | impl Into<String> |
set_attribute
| Name | Type |
|---|---|
key | impl Into<String> |
value | impl Serialize |
add_event
| Name | Type |
|---|---|
event | SpanEvent |
end
| Name | Type |
|---|---|
end_offset | Duration |
set_error
| Name | Type |
|---|---|
message | impl Into<String> |
is_ended
Source
View on GitHub
praisonai/src/trace/mod.rs at line 81
