TraceContext.start constructor

TraceContext.start({
  1. Random? random,
  2. bool sampled = true,
})

Starts a new trace.

Implementation

factory TraceContext.start({Random? random, bool sampled = true}) {
  final source = random ?? _random;
  return TraceContext(
    traceId: _hex(source, 16),
    spanId: _hex(source, 8),
    sampled: sampled,
  );
}