Skip to content

Commit fdaaf3e

Browse files
CagriYoncapvital
authored andcommitted
fix: function call moved into try block
Signed-off-by: Cagri Yonca <cagri@ibm.com>
1 parent 3f9798d commit fdaaf3e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/instana/instrumentation/aioamqp.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ async def basic_publish_with_instana(
2727
) as span:
2828
try:
2929
span.set_attribute("aioamqp.exchange", argv[0])
30+
return await wrapped(*argv, **kwargs)
3031
except Exception as exc:
3132
span.record_exception(exc)
3233
logger.debug(f"aioamqp basic_publish_with_instana error: {exc}")
33-
finally:
34-
return await wrapped(*argv, **kwargs)
3534

3635
@wrapt.patch_function_wrapper("aioamqp.channel", "Channel.basic_consume")
3736
async def basic_consume_with_instana(
@@ -63,11 +62,10 @@ async def callback_wrapper(
6362
span.set_attribute("aioamqp.message", args[1])
6463
span.set_attribute("aioamqp.exchange_name", args[2].exchange_name)
6564
span.set_attribute("aioamqp.routing_key", args[2].routing_key)
65+
return await wrapped_callback(*args, **kwargs)
6666
except Exception as exc:
6767
span.record_exception(exc)
6868
logger.debug(f"aioamqp basic_consume_with_instana error: {exc}")
69-
finally:
70-
return await wrapped_callback(*args, **kwargs)
7169

7270
wrapped_callback = callback_wrapper(callback)
7371
argv = (wrapped_callback,) + argv[1:]

0 commit comments

Comments
 (0)