CurrentSpan class abstract final

The span the current request is inside.

Scoped to a zone rather than to the process, the same way the error sink is, so two servers in one isolate — normal in tests — do not write into each other's traces.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

value Span?
The span of the request being handled, or null outside one.
no setter

Static Methods

runDetached<R>(R body()) → R
Runs body with no current span, whatever the surrounding zone has.
runWith<R>(Span span, R body()) → R
Runs body with span as the current one.
setAttribute(String key, Object? attribute) → void
Records an attribute on the current span, if there is one.
startChild(String name) Span?
Starts a child of the current span, or null when nothing is tracing.