Judgment Labs Logo
Other

AIOHTTP Client

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
aiohttp_client_tracing.py
import asyncio

import aiohttp
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()

On this page

No Headings