---
title: "WSGI Tracing"
description: "Trace generic WSGI applications with Judgment."
sidebar:
  label: "WSGI"
seo:
  title: "WSGI Tracing with Judgment | Integration Docs"
  description: "Trace WSGI spans with Judgment to connect application behavior to production AI agent monitoring and evaluation."
---

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

{/* @test-flow
  id: tracing-web-wsgi
  lang: python
  env: JUDGMENT_API_KEY, JUDGMENT_ORG_ID
*/}

**uv**

```bash
uv add judgeval opentelemetry-instrumentation-wsgi
```

**pip**

```bash
pip install judgeval opentelemetry-instrumentation-wsgi
```

```python title="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)
```
