Span class

Represents a telemetry span - a segment of work with timing.

Spans can be nested to represent parent-child relationships.

Constructors

Span({required String spanId, required String name, required DateTime startTime, DateTime? endTime, Duration duration = Duration.zero, String? parentSpanId, String? traceId, Map<String, String> attributes = const {}})
const

Properties

attributes → Map<String, String>
Additional attributes associated with this span.
final
duration → Duration
Duration of the span.
final
endTime → DateTime?
Timestamp when the span ended.
final
hashCode → int
The hash code for this object.
no setterinherited
name → String
Name of the span (e.g., "odbc.query.execution").
final
parentSpanId → String?
Parent span ID if this is a child span.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
spanId → String
Unique identifier for this span.
final
startTime → DateTime
Timestamp when the span started.
final
traceId → String?
Trace ID this span belongs to.
final

Methods

copyWith({Map<String, String>? attributes, DateTime? endTime, String? parentSpanId}) → Span
Returns a copy of this span with updated attributes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited