Skip to main content

Automatic tracing and integrations

One call — mlflow.<framework>.autolog() — enables tracing for any of 30+ supported frameworks and LLM providers. It patches the library at import time so every LLM invocation, tool call, and agent step is captured as a span with no additional instrumentation.

Enable automatic tracing

note

On serverless compute clusters, autologging is not enabled by default. You must call mlflow.<library>.autolog() explicitly for each integration you want to trace.

Install

Python
%pip install --upgrade "mlflow[databricks]>=3.1.0" "openai>=1.0.0"
# Also install the SDKs for any other frameworks you want to trace
dbutils.library.restartPython()

Set credentials

Python
import os
os.environ["OPENAI_API_KEY"] = "your-api-key"
# Add other provider keys as needed:
# os.environ["ANTHROPIC_API_KEY"] = "your-api-key"

Quickstart examples

Choose your framework to see a minimal working example. Each tab links to the full per-framework guide.

Python
import mlflow
import openai

mlflow.openai.autolog()
mlflow.set_tracking_uri("databricks")
mlflow.set_experiment("/Shared/openai-tracing-demo")

client = openai.OpenAI()
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "What is the capital of France?"}],
)
# Trace appears in the MLflow UI automatically

Full OpenAI guide

All integrations

Each page includes prerequisites, configuration options, and examples beyond the quickstart above.

LLM providers

    • Anthropic
    • Anthropic
    • AWS Bedrock
    • AWS Bedrock
    • Databricks Foundation Model APIs
    • Databricks Foundation Model APIs
    • DeepSeek
    • DeepSeek
    • Google Gemini
    • Google Gemini
    • Groq
    • Groq
    • Mistral
    • Mistral
    • Ollama
    • Ollama
    • OpenAI
    • OpenAI

Agent frameworks and orchestrators

    • AG2
    • AG2
    • Agno
    • Agno
    • AutoGen
    • AutoGen
    • CrewAI
    • CrewAI
    • DSPy
    • DSPy
    • Haystack
    • Haystack
    • LangChain
    • LangChain
    • LangGraph
    • LangGraph
    • LlamaIndex
    • LlamaIndex
    • OpenAI Agents SDK
    • OpenAI Agents SDK
    • PydanticAI
    • PydanticAI
    • Semantic Kernel
    • Semantic Kernel
    • Smolagents
    • Smolagents
    • Strands
    • Strands
    • Swarm
    • Swarm
    • TxtAI
    • TxtAI

Utilities and other

    • Claude Code
    • Claude Code
    • Instructor
    • Instructor
    • LiteLLM
    • LiteLLM
    • OpenTelemetry
    • OpenTelemetry

Disable automatic tracing

Python
import mlflow

# Disable for a specific library
mlflow.openai.autolog(disable=True)

# Disable all autologging at once
mlflow.autolog(disable=True)

Additional resources

Next step: Manual and custom tracing