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

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

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

**uv**

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

**pip**

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

```python title="starlette_tracing.py"
from judgeval import Tracer
from opentelemetry.instrumentation.starlette import StarletteInstrumentor
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route


async def hello(request):
    return JSONResponse({"message": "hello"})


Tracer.init(project_name="starlette_app")

app = Starlette(routes=[Route("/hello", hello)])
StarletteInstrumentor.instrument_app(app)
```
