File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 3636 before_render_template ,
3737 got_request_exception ,
3838 request_started ,
39+ request_finished ,
3940 )
4041 from markupsafe import Markup
4142except ImportError :
@@ -82,6 +83,7 @@ def setup_once():
8283
8384 before_render_template .connect (_add_sentry_trace )
8485 request_started .connect (_request_started )
86+ request_finished .connect (_request_finished )
8587 got_request_exception .connect (_capture_exception )
8688
8789 old_app = Flask .__call__
@@ -152,6 +154,11 @@ def _request_started(app, **kwargs):
152154 scope .add_event_processor (evt_processor )
153155
154156
157+ def _request_finished (sender , response , ** kwargs ):
158+ # Manually close the transaction because Bottle does not call `close()` on the WSGI response
159+ sentry_sdk .get_current_scope ().transaction .__exit__ (None , None , None )
160+
161+
155162class FlaskRequestExtractor (RequestExtractor ):
156163 def env (self ):
157164 # type: () -> Dict[str, str]
You can’t perform that action at this time.
0 commit comments