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

AIOHTTP Server Tracing

Trace AIOHTTP server request spans with Judgment.

AIOHTTP server tracing uses the standard OpenTelemetry AIOHTTP server instrumentation and routes request spans through Judgment.

uv add judgeval aiohttp opentelemetry-instrumentation-aiohttp-server
pip install judgeval aiohttp opentelemetry-instrumentation-aiohttp-server
from aiohttp import web
from judgeval import Tracer
from opentelemetry.instrumentation.aiohttp_server import AioHttpServerInstrumentor

Tracer.init(project_name="aiohttp_server_app")
Tracer.registerOTELInstrumentation(AioHttpServerInstrumentor())


async def hello(request):
    return web.json_response({"message": "hello"})


app = web.Application()
app.router.add_get("/hello", hello)
web.run_app(app)

Was this page helpful?