Skip to content

Commit 68e0c64

Browse files
authored
Mark instrumented functions as coroutines (#134)
1 parent e1c5994 commit 68e0c64

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

instana/instrumentation/asynqp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
try:
1010
import asynqp
11+
import asyncio
1112

1213
@wrapt.patch_function_wrapper('asynqp.exchange','Exchange.publish')
1314
def publish_with_instana(wrapped, instance, argv, kwargs):
@@ -41,6 +42,7 @@ def publish_with_instana(wrapped, instance, argv, kwargs):
4142
else:
4243
return rv
4344

45+
@asyncio.coroutine
4446
@wrapt.patch_function_wrapper('asynqp.queue','Queue.get')
4547
def get_with_instana(wrapped, instance, argv, kwargs):
4648
parent_span = async_tracer.active_span
@@ -63,6 +65,7 @@ def get_with_instana(wrapped, instance, argv, kwargs):
6365

6466
return msg
6567

68+
@asyncio.coroutine
6669
@wrapt.patch_function_wrapper('asynqp.queue','Queue.consume')
6770
def consume_with_instana(wrapped, instance, argv, kwargs):
6871
def callback_generator(original_callback):

0 commit comments

Comments
 (0)