buildTraceParent static method

String buildTraceParent(
  1. String traceId,
  2. String spanId, {
  3. required bool sampled,
})

W3C traceparent: version 00, then the sampled flag as 01 or 00.

Implementation

static String buildTraceParent(String traceId, String spanId,
    {required bool sampled}) {
  return '00-$traceId-$spanId-${sampled ? '01' : '00'}';
}