inject method

  1. @override
void inject(
  1. Context context,
  2. dynamic carrier,
  3. TextMapSetter setter
)
override

Implementation

@override
void inject(api.Context context, dynamic carrier, api.TextMapSetter setter) {
  final spanContext = context.spanContext;

  setter
    ..set(
        carrier,
        _traceParentHeaderKey,
        '$_traceVersion-${spanContext!.traceId.toString()}-'
        '${spanContext.spanId.toString()}-'
        '${spanContext.traceFlags.toRadixString(16).padLeft(2, '0')}')
    ..set(carrier, _traceStateHeaderKey, spanContext.traceState.toString());
}