File tree Expand file tree Collapse file tree
instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4343 ([ #4108 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4108 ) )
4444- ` opentelemetry-instrumentation-tornado ` : Implement new semantic convention opt-in migration
4545 ([ #3993 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3993 ) )
46+ - ` opentelemetry-instrumentation-tornado ` : pass request attributes at span creation
47+ ([ #4140 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4140 ) )
4648- ` opentelemetry-instrumentation-pyramid ` Implement new semantic convention opt-in migration
4749 ([ #3982 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3982 ) )
4850
Original file line number Diff line number Diff line change @@ -754,22 +754,21 @@ def _get_full_handler_name(handler):
754754
755755
756756def _start_span (tracer , handler , sem_conv_opt_in_mode ) -> _TraceContext :
757+ attributes = _get_attributes_from_request (
758+ handler .request , sem_conv_opt_in_mode
759+ )
757760 span , token = _start_internal_or_server_span (
758761 tracer = tracer ,
759762 span_name = _get_default_span_name (handler .request ),
760763 start_time = time_ns (),
761764 context_carrier = handler .request .headers ,
762765 context_getter = textmap .default_getter ,
766+ attributes = attributes ,
763767 )
764768
765769 if span .is_recording ():
766- attributes = _get_attributes_from_request (
767- handler .request , sem_conv_opt_in_mode
768- )
769- for key , value in attributes .items ():
770- span .set_attribute (key , value )
771770 span .set_attribute ("tornado.handler" , _get_full_handler_name (handler ))
772- if span .is_recording () and span . kind == trace .SpanKind .SERVER :
771+ if span .kind == trace .SpanKind .SERVER :
773772 custom_attributes = _collect_custom_request_headers_attributes (
774773 handler .request .headers
775774 )
You can’t perform that action at this time.
0 commit comments