
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
opentelemetry-instrumentation-asyncio
Advanced tools
|pypi|
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-asyncio.svg :target: https://pypi.org/project/opentelemetry-instrumentation-asyncio/
AsyncioInstrumentor: Tracing Requests Made by the Asyncio Library
The opentelemetry-instrumentation-asyncio package allows tracing asyncio applications. It also includes metrics for duration and counts of coroutines and futures. Metrics are generated even if coroutines are not traced.
.. code:: bash
export OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE=coro_name,coro_name2,coro_name3
to_thread
function of asyncio, set the name of the functions in OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE
... code:: bash
export OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE=func_name,func_name2,func_name3
OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED
.. code:: bash
export OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED=true
.. code:: python
# export OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE=sleep
import asyncio
from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor
AsyncioInstrumentor().instrument()
async def main():
await asyncio.create_task(asyncio.sleep(0.1))
asyncio.run(main())
.. code:: python
# 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()
future.set_result(1)
task = asyncio.ensure_future(future)
loop.run_until_complete(task)
.. code:: python
# export OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE=func
import asyncio
from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor
AsyncioInstrumentor().instrument()
async def main():
await asyncio.to_thread(func)
def func():
pass
asyncio.run(main())
asyncio.process.duration
(seconds) - Duration of asyncio processasyncio.process.count
(count) - Number of asyncio process::
pip install opentelemetry-instrumentation-asyncio
OpenTelemetry asyncio/ Tracing <https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/asyncio/asyncio.html>
_OpenTelemetry Project <https://opentelemetry.io/>
_OpenTelemetry Python Examples <https://github.com/open-telemetry/opentelemetry-python/tree/main/docs/examples>
_FAQs
OpenTelemetry instrumentation for asyncio
We found that opentelemetry-instrumentation-asyncio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.