Judgment Labs Logo
Other

MySQL

Trace MySQL spans with Judgment.

MySQL tracing uses the standard OpenTelemetry MySQL instrumentation and routes database spans through Judgment.

uv add judgeval mysql-connector-python opentelemetry-instrumentation-mysql
pip install judgeval mysql-connector-python opentelemetry-instrumentation-mysql
mysql_tracing.py
import mysql.connector
from judgeval import Tracer
from opentelemetry.instrumentation.mysql import MySQLInstrumentor

Tracer.init(project_name="mysql_app")
Tracer.registerOTELInstrumentation(MySQLInstrumentor())

# Create connections normally after registration.
# connection = mysql.connector.connect(
#     host="localhost",
#     user="user",
#     password="password",
#     database="db",
# )

On this page

No Headings