Class AgentSpan
- Namespace
- LMKit.Agents.Observability
- Assembly
- LM-Kit.NET.dll
Represents a traced execution span for agent operations.
Spans track the duration, status, and metadata of agent operations, forming a hierarchical trace of execution.
public sealed class AgentSpan : IDisposable
- Inheritance
-
AgentSpan
- Implements
- Inherited Members
Properties
- Attributes
Gets the attributes attached to this span.
- Duration
Gets the duration of this span, if ended.
- EndTime
Gets the end time of this span, if ended.
- Events
Gets the events recorded during this span.
- Kind
Gets the span kind.
- OperationName
Gets the operation name for this span.
- ParentSpanId
Gets the parent span ID, if this is a child span.
- SpanId
Gets the unique identifier for this span.
- StartTime
Gets the start time of this span.
- Status
Gets or sets the status of this span.
- StatusMessage
Gets or sets the status message.
- TraceId
Gets the trace ID that groups related spans.
Methods
- AddEvent(string, Dictionary<string, object>)
Records an event during this span.
- Dispose()
Disposes the span, ending it if not already ended.
- End()
Ends the span and records the duration.
- RecordException(Exception)
Records an exception event.
- SetAttribute(string, object)
Sets an attribute on this span.
- SetError(string)
Marks the span as failed.
- SetSuccess(string)
Marks the span as successful.