Span class

A Span represents a single operation performed by a single component of the system.

The next available field id is 17.

Inheritance
  • Object
  • GeneratedMessage
  • Span

Constructors

Span.new({List<int>? traceId, List<int>? spanId, String? traceState, List<int>? parentSpanId, String? name, Span_SpanKind? kind, Int64? startTimeUnixNano, Int64? endTimeUnixNano, Iterable<KeyValue>? attributes, int? droppedAttributesCount, Iterable<Span_Event>? events, int? droppedEventsCount, Iterable<Span_Link>? links, int? droppedLinksCount, Status? status, int? flags})
factory
Span.fromBuffer(List<int> i, [ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY])
factory
Span.fromJson(String i, [ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY])
factory

Properties

attributes List<KeyValue>
attributes is a collection of key/value pairs. Note, global attributes like server name can be set using the resource API. Examples of attributes:
no setter
droppedAttributesCount int
dropped_attributes_count is the number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0, then no attributes were dropped.
getter/setter pair
droppedEventsCount int
dropped_events_count is the number of dropped events. If the value is 0, then no events were dropped.
getter/setter pair
droppedLinksCount int
dropped_links_count is the number of dropped links after the maximum size was enforced. If this value is 0, then no links were dropped.
getter/setter pair
endTimeUnixNano ↔ Int64
end_time_unix_nano is the end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the server application handler stops running. Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
getter/setter pair
eventPlugin → EventPlugin?
Subclasses can override this getter to be notified of changes to protobuf fields.
no setterinherited
events List<Span_Event>
events is a collection of Event items.
no setter
flags int
Flags, a bit field. 8 least significant bits are the trace flags as defined in W3C Trace Context specification. Readers MUST not assume that 24 most significant bits will be zero. To read the 8-bit W3C trace flag, use flags & SPAN_FLAGS_TRACE_FLAGS_MASK.
getter/setter pair
hashCode int
Calculates a hash code based on the contents of the protobuf.
no setterinherited
info_ → BuilderInfo
no setteroverride
isFrozen bool
Returns true if this message is marked read-only. Otherwise false.
no setterinherited
kind Span_SpanKind
Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using CLIENT (caller) and SERVER (callee) to identify queueing latency associated with the span.
getter/setter pair
links is a collection of Links, which are references from this span to a span in the same or different trace.
no setter
name String
A description of the span's operation.
getter/setter pair
parentSpanId List<int>
The span_id of this span's parent span. If this is a root span, then this field must be empty. The ID is an 8-byte array.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spanId List<int>
A unique identifier for a span within a trace, assigned when the span is created. The ID is an 8-byte array. An ID with all zeroes OR of length other than 8 bytes is considered invalid (empty string in OTLP/JSON is zero-length and thus is also invalid).
getter/setter pair
startTimeUnixNano ↔ Int64
start_time_unix_nano is the start time of the span. On the client side, this is the time kept by the local machine where the span execution starts. On the server side, this is the time when the server's application handler starts running. Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
getter/setter pair
status Status
An optional final status for this span. Semantically when Status isn't set, it means span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0).
getter/setter pair
traceId List<int>
A unique identifier for a trace. All spans from the same trace share the same trace_id. The ID is a 16-byte array. An ID with all zeroes OR of length other than 16 bytes is considered invalid (empty string in OTLP/JSON is zero-length and thus is also invalid).
getter/setter pair
traceState String
trace_state conveys information about request position in multiple distributed tracing graphs. It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header See also https://github.com/w3c/distributed-tracing for more details about this field.
getter/setter pair
unknownFields → UnknownFieldSet
no setterinherited

Methods

addExtension(Extension extension, Object? value) → void
Adds an extension field value to a repeated field.
inherited
check() → void
inherited
clear() → void
Clears all data that was set in this message.
inherited
clearDroppedAttributesCount() → void
clearDroppedEventsCount() → void
clearDroppedLinksCount() → void
clearEndTimeUnixNano() → void
clearExtension(Extension extension) → void
Clears an extension field and also removes the extension.
inherited
clearField(int tagNumber) → void
Clears the contents of a given field.
inherited
clearFlags() → void
clearKind() → void
clearName() → void
clearParentSpanId() → void
clearSpanId() → void
clearStartTimeUnixNano() → void
clearStatus() → void
clearTraceId() → void
clearTraceState() → void
clone() Span
Creates a deep copy of the fields in this message. (The generated code uses mergeFromMessage.)
override
copyWith(void updates(Span)) Span
Apply updates to a copy of this message.
override
createEmptyInstance() Span
Creates an empty instance of the same message type as this.
override
createMapField<K, V>(int tagNumber, MapFieldInfo<K, V> fi) Map<K, V>
Creates a Map representing a map field.
inherited
createRepeatedField<T>(int tagNumber, FieldInfo<T> fi) List<T>
Creates List implementing a mutable repeated field.
inherited
ensureStatus() Status
extensionsAreInitialized() bool
inherited
freeze() → GeneratedMessage
Make this message read-only.
inherited
getDefaultForField(int tagNumber) → dynamic
Returns the default value for the given field.
inherited
getExtension(Extension extension) → dynamic
Returns the value of extension.
inherited
getField(int tagNumber) → dynamic
Returns the value of the field associated with tagNumber, or the default value if it is not set.
inherited
getFieldOrNull(int tagNumber) → dynamic
Returns the value of a field, ignoring any defaults.
inherited
getTagNumber(String fieldName) int?
inherited
hasDroppedAttributesCount() bool
hasDroppedEventsCount() bool
hasDroppedLinksCount() bool
hasEndTimeUnixNano() bool
hasExtension(Extension extension) bool
Returns true if a value of extension is present.
inherited
hasField(int tagNumber) bool
Whether this message has a field associated with tagNumber.
inherited
hasFlags() bool
hasKind() bool
hasName() bool
hasParentSpanId() bool
hasRequiredFields() bool
Whether the message has required fields.
inherited
hasSpanId() bool
hasStartTimeUnixNano() bool
hasStatus() bool
hasTraceId() bool
hasTraceState() bool
isInitialized() bool
Whether all required fields in the message and embedded messages are set.
inherited
mergeFromBuffer(List<int> input, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void
Merges serialized protocol buffer data into this message.
inherited
mergeFromCodedBufferReader(CodedBufferReader input, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void
inherited
mergeFromJson(String data, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void
Merges field values from data, a JSON object, encoded as described by GeneratedMessage.writeToJson.
inherited
mergeFromJsonMap(Map<String, dynamic> json, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void
Merges field values from a JSON object represented as a Dart map.
inherited
mergeFromMessage(GeneratedMessage other) → void
Merges the contents of the other into this message.
inherited
mergeFromProto3Json(Object? json, {TypeRegistry typeRegistry = const TypeRegistry.empty(), bool ignoreUnknownFields = false, bool supportNamesWithUnderscores = true, bool permissiveEnums = false}) → void
Merges field values from json, a JSON object using proto3 encoding.
inherited
mergeUnknownFields(UnknownFieldSet unknownFieldSet) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setExtension(Extension extension, Object value) → void
Sets the value of a non-repeated extension field to value.
inherited
setField(int tagNumber, Object value) → void
Sets the value of a field by its tagNumber.
inherited
toBuilder() → GeneratedMessage
Creates a writable, shallow copy of this message.
inherited
toDebugString() String
Returns a String representation of this message.
inherited
toProto3Json({TypeRegistry typeRegistry = const TypeRegistry.empty()}) Object?
Returns an Object representing Proto3 JSON serialization of this.
inherited
toString() String
Returns a String representation of this message.
inherited
writeToBuffer() Uint8List
inherited
writeToCodedBufferWriter(CodedBufferWriter output) → void
inherited
writeToJson() String
Returns a JSON string that encodes this message.
inherited
writeToJsonMap() Map<String, dynamic>
Returns the JSON encoding of this message as a Dart Map.
inherited

Operators

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

Static Methods

create() Span
createRepeated() → PbList<Span>
getDefault() Span