Adding support for opentelemetry-instrumentation-asyncio
Description
Currently, the project lacks support [Correct me if i'm wrong] for opentelemetry-instrumentation-asyncio, which would allow better tracing and monitoring of asyncio-based operations. Integrating this instrumentation would enhance observability, making it easier to diagnose performance bottlenecks and errors in async workflows.
Official package: opentelemetry-instrumentation-asyncio
Pretty much any opentelemetry-instrumentation-* will just work as described with logfire activated. Using the first example from their docs:
import asyncio
import os
import logfire
from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor
logfire.configure()
os.environ['OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE'] = 'sleep'
AsyncioInstrumentor().instrument()
async def main():
await asyncio.create_task(asyncio.sleep(0.1))
asyncio.run(main())
Also check out https://logfire.pydantic.dev/docs/reference/api/logfire/#logfire.Logfire.log_slow_async_callbacks . I see we need to make this more discoverable in docs.
Appreciate the info—I’ll check it out!