startChild method

  1. @override
ISentrySpan startChild(
  1. String operation, {
  2. String? description,
  3. DateTime? startTimestamp,
})
override

Starts a child Span.

Implementation

@override
ISentrySpan startChild(
  String operation, {
  String? description,
  DateTime? startTimestamp,
}) {
  if (finished) {
    return NoOpSentrySpan();
  }

  if (startTimestamp?.isBefore(_startTimestamp) ?? false) {
    _hub.options.logger(
      SentryLevel.warning,
      "Start timestamp ($startTimestamp) cannot be before parent span's start timestamp ($_startTimestamp). Returning NoOpSpan.",
    );
    return NoOpSentrySpan();
  }

  return _tracer.startChildWithParentSpanId(
    _context.spanId,
    operation,
    description: description,
    startTimestamp: startTimestamp,
  );
}