copyWith method

Span copyWith({
  1. Map<String, String>? attributes,
  2. DateTime? endTime,
  3. String? parentSpanId,
})

Returns a copy of this span with updated attributes.

Implementation

Span copyWith({
  Map<String, String>? attributes,
  DateTime? endTime,
  String? parentSpanId,
}) {
  return Span(
    spanId: spanId,
    name: name,
    startTime: startTime,
    endTime: endTime ?? this.endTime,
    duration: duration,
    parentSpanId: parentSpanId ?? this.parentSpanId,
    traceId: traceId,
    attributes: attributes ?? this.attributes,
  );
}