We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbd7d1a commit ad3bde9Copy full SHA for ad3bde9
sentry_sdk/integrations/asyncio.py
@@ -21,6 +21,15 @@
21
from sentry_sdk._types import ExcInfo
22
23
24
+def get_name(coro):
25
+ # type: (Any) -> str
26
+ return (
27
+ getattr(coro, "__qualname__", None)
28
+ or getattr(coro, "__name__", None)
29
+ or "coroutine without __name__"
30
+ )
31
+
32
33
def patch_asyncio():
34
# type: () -> None
35
orig_task_factory = None
@@ -37,7 +46,7 @@ async def _coro_creating_hub_and_span():
37
46
result = None
38
47
39
48
with hub:
40
- with hub.start_span(op=OP.FUNCTION, description=coro.__qualname__):
49
+ with hub.start_span(op=OP.FUNCTION, description=get_name(coro)):
41
50
try:
42
51
result = await coro
43
52
except Exception:
0 commit comments