end method
End the span. Emits LogSpan to the pipeline.
Implementation
void end({
SpanStatus status = SpanStatus.ok,
Object? error,
StackTrace? stackTrace,
}) {
if (_ended) return;
_ended = true;
final span = LogSpan(
spanId: spanId,
parentSpanId: parentSpanId,
traceId: traceId,
scope: scope,
name: name,
startTime: _startTime,
endTime: _clock(),
status: status,
error: error,
stackTrace: stackTrace,
data: _data,
events: List.unmodifiable(_events),
);
_onComplete(span);
}