Span class

A representation of a single operation within a trace.

Implemented types

Constructors

Span(String name, SpanContext _spanContext, SpanId? _parentSpanId, List<SpanProcessor> _processors, TimeProvider _timeProvider, Resource _resource, InstrumentationLibrary _instrumentationLibrary, {SpanKind? kind, List<Attribute>? attributes, List<SpanLink>? links, Context? parentContext, SpanLimits? limits, Int64? startTime})
Construct a Span.

Properties

attributes → Attributes
no setter
droppedAttributes int
no setter
endTime → Int64?
Get the time when the span was closed, or null if still open.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
instrumentationLibrary InstrumentationLibrary
Retrieve the instrumentation library on this span.
no setteroverride
isRecording bool
Whether this Span is recording information like events with the addEvent operation, status with setStatus, etc.
no setteroverride
kind SpanKind
The kind of the span.
no setteroverride
no setter
name String
The name of the span.
getter/setter pairoverride
parentSpanId SpanId?
The parent span id.
no setteroverride
resource Resource
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spanContext SpanContext
The context associated with this span.
no setteroverride
startTime → Int64
Get the time when the span was started.
no setteroverride
status SpanStatus
Retrieve the status of the Span.
no setteroverride

Methods

addEvent(String name, Int64 timestamp, {List<Attribute> attributes = const []}) → void
Record metadata about an event occurring during this span.
override
end() → void
Marks the end of this span's execution.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordException(dynamic exception, {StackTrace? stackTrace}) → void
Record metadata about an exception occurring during this span.
override
setAttribute(Attribute attribute) → void
set single attribute
override
setAttributes(List<Attribute> attributes) → void
set multiple attributes
override
setStatus(StatusCode status, {String description = ''}) → void
Sets the status to the Span.
override
toString() String
A string representation of this object.
inherited

Operators

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