LogSpan class

A completed operation span with duration.

Implemented types

Constructors

LogSpan({required String spanId, required String scope, required String name, required DateTime startTime, required DateTime endTime, required LogSpanStatus status, String? parentSpanId, String? traceId, Object? error, StackTrace? stackTrace, Map<String, Object>? data, List<LogEvent> events = const []})
Creates a LogSpan record.
LogSpan.fromJson(Map<String, dynamic> json)
Deserializes a LogSpan from a JSON-compatible map.
factory

Properties

data → Map<String, Object>?
Structured metadata.
final
duration → Duration
How long the operation took.
no setter
endTime → DateTime
When the span ended.
final
error → Object?
Error (if status == error).
final
events → List<LogEvent>
Events that occurred inside this span.
final
hashCode → int
The hash code for this object.
no setterinherited
name → String
Operation name.
final
parentSpanId → String?
Parent span ID (for nested spans).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scope → String
Scope name (e.g. 'rpc.transport.router').
final
spanId → String
Unique span identifier.
final
stackTrace → StackTrace?
Stack trace (if status == error).
final
startTime → DateTime
When the span started.
final
status → LogSpanStatus
Outcome of the operation.
final
timestamp → DateTime
When this record was created.
final
traceId → String?
Trace ID for distributed tracing correlation.
final

Methods

copyWith({String? spanId, String? scope, String? name, DateTime? startTime, DateTime? endTime, LogSpanStatus? status, String? parentSpanId, String? traceId, Object? error, StackTrace? stackTrace, Map<String, Object>? data, List<LogEvent>? events}) → LogSpan
A copy with the given fields replaced. A null argument keeps the field.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this span to a JSON-compatible map.
toString() → String
A string representation of this object.
inherited

Operators

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