diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/README.rst b/instrumentation/opentelemetry-instrumentation-asyncio/README.rst index d78e84679..9c1c3450c 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/README.rst +++ b/instrumentation/opentelemetry-instrumentation-asyncio/README.rst @@ -55,6 +55,11 @@ Run instrumented application # export OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED=true + import asyncio + from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor + + AsyncioInstrumentor().instrument() + loop = asyncio.get_event_loop() future = asyncio.Future() diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py index 2d1b063df..9905d91db 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py @@ -41,6 +41,11 @@ Run instrumented application # export OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED=true + import asyncio + from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor + + AsyncioInstrumentor().instrument() + loop = asyncio.get_event_loop() future = asyncio.Future() @@ -52,6 +57,8 @@ Run instrumented application ------------- .. code:: python + # export OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE=func + import asyncio from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor