Skip to content
Judgment Labs
Esc
↑↓navigate↵open⌘Jpreview

AIOHTTP Client Tracing

Trace AIOHTTP client requests with Judgment.

AIOHTTP client tracing uses the standard OpenTelemetry AIOHTTP client instrumentation and routes outbound HTTP spans through Judgment.

uv add judgeval aiohttp opentelemetry-instrumentation-aiohttp-client
pip install judgeval aiohttp opentelemetry-instrumentation-aiohttp-client

from judgeval import Tracer
from opentelemetry.instrumentation.aiohttp_client import AioHttpClientInstrumentor

Tracer.init(project_name="aiohttp_client_app")
Tracer.registerOTELInstrumentation(AioHttpClientInstrumentor())


async def main():
    async with aiohttp.ClientSession() as session:
        async with session.get("https://example.com") as response:
            await response.text()


asyncio.run(main())
Tracer.force_flush()

Was this page helpful?