parseTraceContextFromHeaderValue function

TraceContext parseTraceContextFromHeaderValue(
  1. String traceContextHeaderValue
)

Backwards compatible parser used where a non-null TraceContext must always be returned. Delegates to tryExtractTraceContext; if extraction fails, a new randomly generated TraceContext is returned.

Implementation

TraceContext parseTraceContextFromHeaderValue(String traceContextHeaderValue) {
  return tryExtractTraceContext(traceContextHeaderValue) ?? TraceContext();
}