Trace and evaluate GenAI applications including LLM calls, agents, RAG pipelines, and multi-step AI systems in Domino. Uses the Domino SDK (@add_tracing decorator, DominoRun context) with MLflow 3.2.0. Captures token usage, latency, cost, tool calls, and errors. Supports LLM-as-judge evaluators and custom metrics. Use when building agents, debugging LLM applications, or needing audit trails for GenAI systems.
This skill provides comprehensive knowledge for tracing and evaluating GenAI applications in Domino Data Lab, including LLM calls, agents, RAG pipelines, and multi-step AI systems.
GenAI tracing works differently depending on where your code runs:
| Mode | Where traces appear | When to use |
|---|---|---|
| Deployed App (Production) | App Performance tab | FastAPI/Flask apps deployed as Domino Apps |
| Development / Evaluation | Experiments UI | Batch scripts, Domino Jobs, Workspaces |
Critical difference: In a deployed Domino App, Domino auto-creates an experiment named agent_experiment_{app_id} and the Performance tab reads from it. If you call mlflow.set_experiment() or wrap calls in DominoRun(), traces go to your custom experiment instead — and the Performance tab won't see them.
The Domino SDK automatically captures:
@add_tracing decorator - Wraps agent functions to capture traces (works standalone — no DominoRun required)mlflow.start_span() - Creates child spans for LLM calls and tool executions inside the agent loopDominoRun context manager - Groups traces into runs for development/evaluation (Experiments UI only)For a FastAPI app deployed as a Domino App. Traces appear in the App Performance tab.
# main.py — lifespan: autolog only, NO set_experiment, NO DominoRun
import mlflow
from fastapi import FastAPI
from contextlib import asynccontextmanager
@asynccontextmanager
async def lifespan(app: FastAPI):
# Each autolog in its own try/except so one failure doesn't block the other
try:
mlflow.openai.autolog()
except Exception:
pass
try:
mlflow.anthropic.autolog()
except Exception:
pass
yield
app = FastAPI(lifespan=lifespan)# orchestrator.py — @add_tracing on the core agent function
import mlflow
from domino.agents.tracing import add_tracing
@add_tracing(
name="agent_turn",
span_type="AGENT",
autolog_frameworks=["openai", "anthropic"],
)
async def run_agent(messages: list[dict]) -> dict:
# LLM calls and tool calls go here (see ADD-TRACING-DECORATOR.md)
...
# router.py — call the traced function directly, NO DominoRun wrapper
@app.post("/chat")
async def chat(request: ChatRequest):
return await run_agent(request.messages)For batch scripts, Domino Jobs, or Workspaces. Traces appear in the Experiments UI.
import mlflow
from domino.agents.tracing import add_tracing
from domino.agents.logging import DominoRun
mlflow.openai.autolog()
@add_tracing(name="my_agent", autolog_frameworks=["openai"])
def my_agent(query: str) -> str:
response = llm.invoke(query)
return response
# DominoRun groups traces into a run visible in Experiments
with DominoRun() as run:
result = my_agent("What is machine learning?")| Framework | Auto-log Command |
|---|---|
| OpenAI | mlflow.openai.autolog() |
| Anthropic | mlflow.anthropic.autolog() |
| LangChain | mlflow.langchain.autolog() |
agent_experiment_{app_id})Official GenAI Tracing Tutorial: https://github.com/dominodatalab/GenAI-Tracing-Tutorial
d86698d
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.