Java Code Examples for brave.propagation.B3SingleFormat#parseB3SingleFormat()

The following examples show how to use brave.propagation.B3SingleFormat#parseB3SingleFormat() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BraveTracer.java    From brave-opentracing with Apache License 2.0 5 votes vote down vote up
@Override public TraceContextOrSamplingFlags extract(BinaryExtract binaryExtract) {
  try {
    return B3SingleFormat.parseB3SingleFormat(ascii.decode(binaryExtract.extractionBuffer()));
  } catch (RuntimeException e) {
    return TraceContextOrSamplingFlags.EMPTY;
  }
}
 
Example 2
Source File: WebClientTests.java    From spring-cloud-sleuth with Apache License 2.0 5 votes vote down vote up
@RequestMapping(value = "/traceid", method = RequestMethod.GET)
public String traceId(@RequestHeader("b3") String b3Single) {
	TraceContextOrSamplingFlags traceContext = B3SingleFormat
			.parseB3SingleFormat(b3Single);
	then(traceContext.context()).isNotNull();
	return b3Single;
}
 
Example 3
Source File: WebClientTests.java    From spring-cloud-sleuth with Apache License 2.0 4 votes vote down vote up
@RequestMapping("/noresponse")
public void noResponse(@RequestHeader("b3") String b3Single) {
	TraceContextOrSamplingFlags traceContext = B3SingleFormat
			.parseB3SingleFormat(b3Single);
	then(traceContext.context()).isNotNull();
}