@@ -140,7 +140,7 @@ def _start_span(ctx: core.ExecutionContext, call_trace: bool = True, **kwargs) -
140140
141141 if config ._inferred_proxy_services_enabled :
142142 # dispatch event for checking headers and possibly making an inferred proxy span
143- core .dispatch ("inferred_proxy.start" , (ctx , tracer , span_kwargs , call_trace , integration_config ))
143+ core .dispatch ("inferred_proxy.start" , (ctx , tracer , span_kwargs , call_trace ))
144144 # re-get span_kwargs in case an inferred span was created and we have a new span_kwargs.child_of field
145145 span_kwargs = ctx .get_item ("span_kwargs" , span_kwargs )
146146
@@ -246,14 +246,15 @@ def _set_inferred_proxy_tags(span, status_code):
246246 inferred_span .set_tag (ERROR_STACK , span .get_tag (ERROR_STACK ))
247247
248248
249- def _on_inferred_proxy_start (ctx , tracer , span_kwargs , call_trace , integration_config ):
249+ def _on_inferred_proxy_start (ctx , tracer , span_kwargs , call_trace ):
250250 # Skip creating another inferred span if one has already been created for this request
251251 if ctx .get_item ("inferred_proxy_span" ):
252252 return
253253
254254 # some integrations like Flask / WSGI store headers from environ in 'distributed_headers'
255255 # and normalized headers in 'headers'
256256 headers = ctx .get_item ("headers" , ctx .get_item ("distributed_headers" , None ))
257+ integration_config = ctx .get_item ("integration_config" )
257258
258259 # Inferred Proxy Spans
259260 if integration_config and headers is not None :
@@ -995,14 +996,15 @@ def _set_client_ip_tags(scope: Mapping[str, Any], span: Span):
995996 log .debug ("Could not validate client IP address for websocket send message: %s" , str (e ))
996997
997998
998- def _on_asgi_websocket_receive_message (ctx , scope , message , integration_config ):
999+ def _on_asgi_websocket_receive_message (ctx , scope , message ):
9991000 """
10001001 Handle websocket receive message events.
10011002
10021003 This handler is called when a websocket receive message event is dispatched.
10031004 It sets up the span with appropriate tags, metrics, and links.
10041005 """
10051006 span = ctx .span
1007+ integration_config = ctx .get_item ("integration_config" )
10061008
10071009 span .set_tag_str (COMPONENT , integration_config .integration_name )
10081010 span .set_tag_str (SPAN_KIND , SpanKind .CONSUMER )
@@ -1025,14 +1027,15 @@ def _on_asgi_websocket_receive_message(ctx, scope, message, integration_config):
10251027 _copy_trace_level_tags (span , ctx .parent .span )
10261028
10271029
1028- def _on_asgi_websocket_send_message (ctx , scope , message , integration_config ):
1030+ def _on_asgi_websocket_send_message (ctx , scope , message ):
10291031 """
10301032 Handle websocket send message events.
10311033
10321034 This handler is called when a websocket send message event is dispatched.
10331035 It sets up the span with appropriate tags, metrics, and links.
10341036 """
10351037 span = ctx .span
1038+ integration_config = ctx .get_item ("integration_config" )
10361039
10371040 span .set_tag_str (COMPONENT , integration_config .integration_name )
10381041 span .set_tag_str (SPAN_KIND , SpanKind .PRODUCER )
@@ -1049,14 +1052,15 @@ def _on_asgi_websocket_send_message(ctx, scope, message, integration_config):
10491052 )
10501053
10511054
1052- def _on_asgi_websocket_close_message (ctx , scope , message , integration_config ):
1055+ def _on_asgi_websocket_close_message (ctx , scope , message ):
10531056 """
10541057 Handle websocket close message events.
10551058
10561059 This handler is called when a websocket close message event is dispatched.
10571060 It sets up the span with appropriate tags, metrics, and links.
10581061 """
10591062 span = ctx .span
1063+ integration_config = ctx .get_item ("integration_config" )
10601064
10611065 span .set_tag_str (COMPONENT , integration_config .integration_name )
10621066 span .set_tag_str (SPAN_KIND , SpanKind .PRODUCER )
@@ -1077,14 +1081,15 @@ def _on_asgi_websocket_close_message(ctx, scope, message, integration_config):
10771081 _copy_trace_level_tags (span , ctx .parent .span )
10781082
10791083
1080- def _on_asgi_websocket_disconnect_message (ctx , scope , message , integration_config ):
1084+ def _on_asgi_websocket_disconnect_message (ctx , scope , message ):
10811085 """
10821086 Handle websocket disconnect message events.
10831087
10841088 This handler is called when a websocket disconnect message event is dispatched.
10851089 It sets up the span with appropriate tags, metrics, and links.
10861090 """
10871091 span = ctx .span
1092+ integration_config = ctx .get_item ("integration_config" )
10881093
10891094 span .set_tag_str (COMPONENT , integration_config .integration_name )
10901095 span .set_tag_str (SPAN_KIND , SpanKind .CONSUMER )
0 commit comments