Judgment Labs Logo
Other

WSGI

Trace generic WSGI applications with Judgment.

WSGI tracing uses the standard OpenTelemetry WSGI middleware and routes request spans through Judgment.

uv add judgeval opentelemetry-instrumentation-wsgi
pip install judgeval opentelemetry-instrumentation-wsgi
wsgi_tracing.py
from judgeval import Tracer
from opentelemetry.instrumentation.wsgi import OpenTelemetryMiddleware

Tracer.init(project_name="wsgi_app")


def application(environ, start_response):
    start_response("200 OK", [("Content-Type", "text/plain")])
    return [b"hello"]


application = OpenTelemetryMiddleware(application)

On this page

No Headings