Skip to content

Commit cc4a786

Browse files
committed
Improve asyncio instrumentation examples
1 parent 6114b60 commit cc4a786

File tree

1 file changed

+7
-0
lines changed
  • instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio

1 file changed

+7
-0
lines changed

instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ async def main():
4141
4242
# export OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED=true
4343
44+
import asyncio
45+
from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor
46+
47+
AsyncioInstrumentor().instrument()
48+
4449
loop = asyncio.get_event_loop()
4550
4651
future = asyncio.Future()
@@ -52,6 +57,8 @@ async def main():
5257
-------------
5358
.. code:: python
5459
60+
# export OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE=func
61+
5562
import asyncio
5663
from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor
5764

0 commit comments

Comments
 (0)