Other
ASGI
Trace generic ASGI applications with Judgment.
ASGI tracing uses the standard OpenTelemetry ASGI middleware and routes request spans through Judgment.
uv add judgeval opentelemetry-instrumentation-asgipip install judgeval opentelemetry-instrumentation-asgifrom judgeval import Tracer
from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware
Tracer.init(project_name="asgi_app")
async def application(scope, receive, send):
await send(
{
"type": "http.response.start",
"status": 200,
"headers": [(b"content-type", b"text/plain")],
}
)
await send({"type": "http.response.body", "body": b"hello"})
app = OpenTelemetryMiddleware(application)