private SpanContext extract ( HttpRequest request ) { SpanContext spanContext = tracer . extract ( Format . Builtin . HTTP_HEADERS , new HttpTextMapExtractAdapter ( request ) ) ; if ( spanContext != null ) { return spanContext ; } Span span = tracer . activeSpan ( ) ; if ( span != null ) { return span . context ( ) ; } return null ; }
Extract context from headers or from active Span