Other
Asyncpg
Trace Asyncpg PostgreSQL spans with Judgment.
Asyncpg tracing uses the standard OpenTelemetry Asyncpg instrumentation and routes PostgreSQL spans through Judgment.
uv add judgeval asyncpg opentelemetry-instrumentation-asyncpgpip install judgeval asyncpg opentelemetry-instrumentation-asyncpgimport asyncpg
from judgeval import Tracer
from opentelemetry.instrumentation.asyncpg import AsyncPGInstrumentor
Tracer.init(project_name="asyncpg_app")
Tracer.registerOTELInstrumentation(AsyncPGInstrumentor())
# Create connections normally after registration.
# conn = await asyncpg.connect("postgresql://user:password@localhost/db")
# await conn.execute("select 1")