File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
opentelemetry-instrumentation-tower/src Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -450,7 +450,11 @@ where
450450 // Extract custom request attributes
451451 let custom_request_attributes = self . request_extractor . extract_attributes ( & req) ;
452452
453- // Start tracing span
453+ // Extract the context from the incoming request headers
454+ let parent_cx = global:: get_text_map_propagator ( |propagator| {
455+ propagator. extract ( & HeaderExtractor ( req. headers ( ) ) )
456+ } ) ;
457+
454458 let mut span_attributes = vec ! [
455459 KeyValue :: new( semconv:: trace:: HTTP_REQUEST_METHOD , method. clone( ) ) ,
456460 url_scheme_kv. clone( ) ,
@@ -484,7 +488,7 @@ where
484488 . span_builder ( span_name)
485489 . with_kind ( SpanKind :: Server )
486490 . with_attributes ( span_attributes)
487- . start ( & tracer) ;
491+ . start_with_context ( & tracer, & parent_cx ) ;
488492
489493 let cx = OtelContext :: current_with_span ( span) ;
490494
You can’t perform that action at this time.
0 commit comments