55
55
TRANSACTION_STYLE_VALUES = ("handler_name" , "method_and_path_pattern" )
56
56
57
57
58
- def create_trace_config () -> TraceConfig :
59
- async def on_request_start (
60
- session : ClientSession ,
61
- trace_config_ctx : "SimpleNamespace" ,
62
- params : "TraceRequestStartParams" ,
63
- ):
58
+ def create_trace_config ():
59
+ # type: () -> TraceConfig
60
+ async def on_request_start (session , trace_config_ctx , params ):
61
+ # type: (ClientSession, SimpleNamespace, TraceRequestStartParams) -> None
64
62
hub = Hub .current
65
63
if hub .get_integration (AioHttpIntegration ) is None :
66
64
return
@@ -84,11 +82,8 @@ async def on_request_start(
84
82
85
83
trace_config_ctx .span = span
86
84
87
- async def on_request_end (
88
- session : ClientSession ,
89
- trace_config_ctx : "SimpleNamespace" ,
90
- params : "TraceRequestEndParams" ,
91
- ):
85
+ async def on_request_end (session , trace_config_ctx , params ):
86
+ # type: (ClientSession, SimpleNamespace, TraceRequestEndParams) -> None
92
87
if trace_config_ctx .span is None :
93
88
return
94
89
@@ -223,6 +218,7 @@ async def sentry_urldispatcher_resolve(self, request):
223
218
old_client_session_init = ClientSession .__init__
224
219
225
220
def init (* args , ** kwargs ):
221
+ # type: (Any, Any) -> ClientSession
226
222
hub = Hub .current
227
223
if hub .get_integration (AioHttpIntegration ) is None :
228
224
return old_client_session_init (* args , ** kwargs )
0 commit comments