| name | domino-genai-tracing |
| description | 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. |
Domino GenAI Tracing Skill
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.
Two Deployment Modes
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.
Key Concepts
What GenAI Tracing Captures
The Domino SDK automatically captures:
- Token usage - Input and output tokens per call
- Latency - Time for each operation
- Cost - Estimated cost per call
- Tool calls - Function/tool invocations
- Errors - Exceptions and failure modes
- Model parameters - Temperature, max_tokens, etc.
Core Components
@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 loop
DominoRun context manager - Groups traces into runs for development/evaluation (Experiments UI only)
- Evaluators - Custom functions to score outputs
- MLflow integration - View traces in Experiment Manager or App Performance tab
Related Documentation
Quick Start — Deployed App (Production)
For a FastAPI app deployed as a Domino App. Traces appear in the App Performance tab.
import mlflow
from fastapi import FastAPI
from contextlib import asynccontextmanager
@asynccontextmanager
async def lifespan(app: FastAPI):
try:
mlflow.openai.autolog()
except Exception:
pass
try:
mlflow.anthropic.autolog()
except Exception:
pass
yield
app = FastAPI(lifespan=lifespan)
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:
...
@app.post("/chat")
async def chat(request: ChatRequest):
return await run_agent(request.messages)
Quick Start — Development / Evaluation
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
with DominoRun() as run:
result = my_agent("What is machine learning?")
Framework Support
| Framework | Auto-log Command |
|---|
| OpenAI | mlflow.openai.autolog() |
| Anthropic | mlflow.anthropic.autolog() |
| LangChain | mlflow.langchain.autolog() |
Viewing Traces
Deployed Apps (Production)
- Navigate to your Domino App
- Click the Performance tab
- Traces appear automatically (routed to
agent_experiment_{app_id})
Development / Evaluation
- Navigate to Experiments in your Domino project
- Select the experiment
- Select a run
- View the Traces tab for span tree visualization
Blueprint Reference
Official GenAI Tracing Tutorial:
https://github.com/dominodatalab/GenAI-Tracing-Tutorial
Documentation Links