Span class abstract

Span represents a logical unit of work as part of a broader Trace. Examples of Span might include remote procedure calls or a in-process function calls to sub-components. A Trace has a single, top-level "root" Span that in turn may have zero or more child Spans, which in turn may have children.

Implementers

Constructors

Span()

Properties

context SpanContext
Each span will have an associated SpanContext.
no setter
duration Duration?
Each span has a duration.
no setter
endTime DateTime?
Each span has a UTC timestamp describing when it ended.
no setter
hashCode int
The hash code for this object.
no setterinherited
logData List<LogData>?
Every Span has zero or more Logs, each of which being a timestamped event name, optionally accompanied by a structured data payload of arbitrary size. The event name should be the stable identifier for some notable moment in the lifetime of a Span. For instance, a Span representing a browser page load might add an event for each field in Performance.timing.
no setter
operationName String?
Each Span has an operation name, a human-readable string which concisely represents the work done by the Span (e.g., an RPC method name, a function name, or the name of a subtask or stage within a larger computation). The operation name should be the most general (i.e., least specific) string that identifies a (statistically) interesting class of Span instances; more specific sub-classes should be described using Tags.
no setter
parentContext SpanContext?
Each span may or may not have an associated parentContext.
no setter
references List<Reference>?
A Span may reference zero or more Spans that are causally related. OpenTracing presently defines two types of references: ChildOf and FollowsFrom. Both reference types specifically model direct causal relationships between a child Span and a parent Span.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startTime DateTime?
Each span has a UTC timestamp describing when it started.
getter/setter pair
tags Map<String, dynamic>?
Every Span may also have zero or more key:value Tags, which do not have timestamps and simply annotate the spans. As is the case with Logs, if certain known tag key:values are used for common application scenarios, tracers can choose to pay special attention to them.
no setter
whenFinished Future<Span>
A hook for on finish event
no setter

Methods

addTags(Map<String, dynamic> keyValuePairs) → void
Adds a single tag to the Span. See addTags() for details. Adds the given key value pairs to the set of Span tags.
finish({DateTime? finishTime}) → void
Sets the end timestamp and finalizes Span state.
log(String event, {Object? payload, DateTime? timestamp}) → void
Explicitly creates a log record associated with the Span.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setTag(String key, dynamic value) → void
Tags this span with the current key-value pair.
toString() String
A string representation of this object.
inherited

Operators

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