Judgment Labs Logo
Other

Flask Tracing

Trace Flask request spans with Judgment.

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

uv add judgeval flask opentelemetry-instrumentation-flask
pip install judgeval flask opentelemetry-instrumentation-flask
flask_tracing.py
from flask import Flask, jsonify
from judgeval import Tracer
from opentelemetry.instrumentation.flask import FlaskInstrumentor

Tracer.init(project_name="flask_app")

app = Flask(__name__)
FlaskInstrumentor().instrument_app(app)


@app.get("/hello")
def hello():
    return jsonify({"message": "hello"})

On this page

No Headings