Span class final
One timed operation inside a trace.
Mutable on purpose. A handler adds attributes to the span it is already inside while the work happens, and forcing a rebuild for each one would put plumbing in every handler that wants to record a customer id.
Constructors
Properties
-
attributes
→ Map<
String, Object?> -
What was recorded about it.
final
- context → TraceContext
-
The trace and span ids.
final
- duration → Duration?
-
How long it ran, or
nullwhile it is running.no setter - endedAt ↔ DateTime?
-
When it finished, or
nullwhile it is running.getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
- isFinished → bool
-
Whether it has finished.
no setter
- name ↔ String
-
What this span measures:
GET /todos/{id},db.query.getter/setter pair - parentSpanId → String?
-
The span this one is inside, or
nullat the root of a trace.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startedAt → DateTime
-
When it started, in UTC.
final
- status ↔ SpanStatus
-
How it finished.
getter/setter pair
Methods
-
child(
String name) → Span - Starts a child span of this one, in the same trace.
-
end(
{DateTime? at, SpanStatus? status}) → void - Marks this span finished.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAttribute(
String key, Object? value) → void - Records one attribute.
-
setAttributes(
Map< String, Object?> values) → void - Records several attributes at once.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited