Skip to content

Commit 36f1b25

Browse files
committed
Reorder on finish call order to correctly close traces
1 parent c8ec25a commit 36f1b25

File tree

1 file changed

+2
-1
lines changed
  • instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado

1 file changed

+2
-1
lines changed

Diff for: instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,9 @@ def _prepare(tracer, request_hook, func, handler, args, kwargs):
208208

209209

210210
def _on_finish(tracer, func, handler, args, kwargs):
211+
response = func(*args, **kwargs)
211212
_finish_span(tracer, handler)
212-
return func(*args, **kwargs)
213+
return response
213214

214215

215216
def _log_exception(tracer, func, handler, args, kwargs):

0 commit comments

Comments
 (0)