traceEnd function

void traceEnd(
  1. String kind,
  2. String method,
  3. TraceContext? ctx,
  4. String status,
)

Implementation

void traceEnd(String kind, String method, TraceContext? ctx, String status) {
  final tracer = _tracer;
  if (ctx == null || tracer == null || !ctx.sampled) return;
  try {
    tracer.onEnd(kind, method, ctx.traceId, ctx.spanId, status,
        ctx._clock.elapsedMicroseconds / 1000.0);
  } catch (_) {
    // observers must never break the call
  }
}