19
19
20
20
21
21
Set the name of the coroutine you want to trace.
22
- -----------------------------------------------
22
+ -------------------------------------------------
23
23
.. code::
24
24
export OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE=coro_name,coro_name2,coro_name3
25
25
26
26
If you want to keep track of which function to use in the to_thread function of asyncio, set the name of the function.
27
- -----------------------------------------------
27
+ ------------------------------------------------------------------------------------------------------------------------
28
28
.. code::
29
29
export OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE=func_name,func_name2,func_name3
30
30
31
31
For future, set it up like this
32
- -----------------------------------------------
32
+ ---------------------------------
33
33
.. code::
34
34
export OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED=true
35
35
36
36
Run instrumented application
37
- -----------------------------------------------
37
+ ------------------------------
38
38
1. coroutine
39
- -----------------------------------------------
39
+ ----------------
40
40
.. code:: python
41
41
42
42
# export OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE=sleep
@@ -52,7 +52,7 @@ async def main():
52
52
asyncio.run(main())
53
53
54
54
2. future
55
- -----------------------------------------------
55
+ ------------
56
56
.. code:: python
57
57
58
58
# export OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED=true
@@ -65,7 +65,7 @@ async def main():
65
65
loop.run_until_complete(task)
66
66
67
67
3. to_thread
68
- -----------------------------------------------
68
+ -------------
69
69
.. code:: python
70
70
71
71
# export OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE=func
@@ -85,7 +85,7 @@ def func():
85
85
86
86
87
87
asyncio metric types
88
- -----------------------------------------------
88
+ ---------------------
89
89
90
90
* `asyncio.futures.duration` (ms) - Duration of the future
91
91
* `asyncio.futures.exceptions` (count) - Number of exceptions raised by the future
0 commit comments