Skip to main content

tools for AI trace monitoring

Summary

  • AI trace monitoring is the continuous review of production traces from LLM apps and agents: filtering for failures and slow steps, scoring a sample for quality, and alerting when patterns shift.
  • Good trace monitoring tools log traces asynchronously with sampling, attach user, session and version context, support filtered search, and run LLM judges on live traffic.
  • MLflow Tracing (open source, OpenTelemetry-compatible) covers capture, context and search, and MLflow's automatic evaluation runs LLM judges on traces as they're logged.
  • Every flagged trace should be one step away from your evaluation dataset, so a production failure becomes a regression test.
  • On Databricks, traces stored in Unity Catalog can be queried with SQL, charted and alerted on, and production monitoring (Beta) runs registered scorers on a sample of incoming traces.

tools for AI trace monitoring

The tools that matter for AI trace monitoring do three things once a trace exists. They let you find the production traces worth looking at (errors, slow spans, unhappy users), they score a sample of traffic automatically with LLM judges, and they alert you when something drifts. An open tracing layer such as MLflow Tracing, plus a trace store you can query, covers most of it. Capturing traces is the easy part. Watching them is where agents get fixed.

What is AI trace monitoring?

Tracing records what an LLM app or agent did on one request. Trace monitoring is the ongoing practice of reviewing those records in production: spotting failures, tracking quality and cost, and routing bad examples back into testing. Each signal lives in a different part of the trace.

Signal in the trace What it often means How to monitor it
Error status on a trace or span A failing tool, bad arguments or an upstream outage Filter on trace status and alert on error counts
Slow trace or slow span Model latency, slow retrieval or retries Filter on execution time, then read span durations
Token usage jump Prompt growth, agent loops or larger context Aggregate per-trace token usage by app version
Low groundedness or safety score Hallucination or unsafe output LLM judges on a sample of live traces
Frustration across a session The agent isn't resolving the request Session-level (multi-turn) judges
Negative user feedback A bad answer the user noticed End-user feedback logged on the trace

What to look for in trace monitoring tools

  • Low-overhead capture. Asynchronous logging, trace sampling and a lightweight SDK, so monitoring doesn't slow the app.
  • Context on every trace. User, session, environment and app version, so you can group and compare.
  • Search. Filters on status, latency and tags in the UI and in code.
  • Online scoring. LLM judges that run on sampled traffic, with filters to target specific traces.
  • Dashboards and alerts. Trends over time and a notification when a threshold is crossed.
  • A feedback loop. One step from a flagged trace to a labeled test case.

Setting up trace monitoring with open-source MLflow

MLflow logs traces asynchronously by default in OSS, and MLFLOW_TRACE_SAMPLING_RATIO controls what share of traces is exported. mlflow.tracing.context() attaches session and user IDs to every trace created inside it (MLflow 3.11.0 and later), and mlflow.search_traces() returns matching traces as a pandas DataFrame.

import mlflow

mlflow.langchain.autolog()

def handle(request):
    with mlflow.tracing.context(session_id=request.session_id, user=request.user_id):
        return agent.invoke(request.message)

# Pull slow traces for review
slow = mlflow.search_traces(filter_string="trace.execution_time_ms > 1000")
failed = mlflow.search_traces(filter_string="trace.status = 'ERROR'")

For quality, MLflow's automatic evaluation runs LLM judges on traces and multi-turn sessions as they're logged. You register a judge, then start it with a ScorerSamplingConfig that sets the sample rate. Automatic evaluation supports LLM judges only; code-based scorers stay in offline evaluation.

How Databricks approaches trace monitoring

MLflow on Databricks is the same open-source MLflow, managed, so the instrumentation above carries over. Databricks adds a governed store and a managed scoring service:

  • Traces you can query. Databricks recommends storing traces in Unity Catalog as OpenTelemetry-format Delta tables. From there you can query them with a SQL warehouse, build AI/BI Dashboards, set alerts, or ask Genie Code about them in plain language.
  • Production monitoring (Beta). Registered scorers run automatically on a configurable sample of incoming traces, and results attach to each trace as feedback. A filter_string in the sampling config targets specific traces using mlflow.search_traces() syntax.
from mlflow.genai.scorers import Safety, ScorerSamplingConfig

safety_judge = Safety().register(name="safety")
safety_judge = safety_judge.start(sampling_config=ScorerSamplingConfig(sample_rate=0.7))
  • Requirements to know. For Unity Catalog traces, set a SQL warehouse with set_databricks_monitoring_sql_warehouse_id(), or monitoring jobs fail. The job runs as the user who first registered a scorer on the experiment.
  • Agents on Model Serving. Deploying an agent with agents.deploy() logs agent interactions to an MLflow experiment in real time and creates inference tables that log requests and responses.
  • From trace to test. merge_records() adds selected traces to an evaluation dataset in Unity Catalog.

Details are in set up production monitoring and Unity Catalog trace storage.

FAQs

How is trace monitoring different from tracing?

Tracing captures what happened on a request. Trace monitoring is the ongoing review of production traces, using filters, automated judges, dashboards and alerts to catch failures and quality drops.

Should I score every production trace?

Not necessarily. Databricks suggests a full sample rate for critical scorers and a lower rate for expensive ones, and MLflow's trace sampling can reduce how many traces you export at all.

Can I monitor multi-turn agent conversations?

Yes. Tag traces with a session ID, and session-level judges such as UserFrustration or ConversationCompleteness evaluate the whole conversation.

What do I do with a bad trace?

Label it, add the expected answer, and put it in your evaluation dataset so the fix gets a regression test.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.