Judgment Labs Logo
Other

AIOHTTP Server

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
aiohttp_server_tracing.py
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)

On this page

No Headings