Span class

Trace span.

Constructors

Span({required String traceId, required String spanId, String? parentSpanId, required String name, required DateTime startTime, required Map<String, dynamic> attributes, required TraceSink sink})

Properties

attributes Map<String, dynamic>
Span attributes.
final
duration Duration?
Get duration.
no setter
endTime DateTime?
Get end time.
no setter
events List<SpanEvent>
Get events.
no setter
hashCode int
The hash code for this object.
no setterinherited
name String
Span name.
final
parentSpanId String?
Parent span ID.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spanId String
Span ID.
final
startTime DateTime
Start time.
final
status SpanStatus
Get span status.
no setter
traceId String
Trace ID.
final

Methods

addEvent(String name, {Map<String, dynamic>? attributes}) → void
Add event.
end() → void
End span.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordError(Object error, [StackTrace? stackTrace]) → void
Record error.
setAttribute(String key, dynamic value) → void
Set attribute.
setStatus(SpanStatus status) → void
Set span status.
startChild(String childName, {Map<String, dynamic>? attributes}) Span
Start a child span under this span.
toSpanData() SpanData
Convert to span data.
toString() String
A string representation of this object.
inherited

Operators

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