withContext method

Future<void> withContext(
  1. Future<void> block()
)

Runs block in a zone where CustomSpanRegistry.getActiveGlobalSpanId returns this span’s id, so Dart-side instrumentation can correlate work.

Implementation

Future<void> withContext(Future<void> Function() block) {
  return CustomSpanRegistry.runWithActiveGlobalSpan(spanId, block);
}