Skip to main content
Agents built on Databricks - declaratively with Agent Bricks or code-first with the Mosaic AI Agent Framework - are auto-instrumented by MLflow 3 Tracing. AgentX plugs into that in three complementary ways; pick per environment, they compose freely:

Push: live OTLP export

MLflow 3 exports traces over OpenTelemetry natively. One helper sets the environment variables - call it before the first trace starts:
  • dual=True (default) also keeps MLflow’s own export, so the Databricks MLflow UI and inference tables keep working (it sets MLFLOW_TRACE_ENABLE_OTLP_DUAL_EXPORT).
  • AgentX maps MLflow’s native span attributes (mlflow.spanInputs/spanOutputs/spanType) directly - inputs, outputs, tool calls, and the full span tree arrive without any flags. genai_semconv=True switches to OTel GenAI semantic conventions if you prefer them.
  • Deployed endpoints: enable_mlflow_export(dry_run=True, ...) returns the exact variables to paste into the Model Serving endpoint’s environment-variable configuration.

Pull: agentx-databricks sync

For serving endpoints where egress env vars are awkward, or to backfill history, the SDK installs a cron-friendly importer that reads finished traces from the MLflow tracking server (pip install "agentx-python[databricks]"):
What each MLflow trace becomes: Flags mirror agentx-moveworks: --monitor opts imported traces into ingest-time checks (patterns, PII, tool failure), --judge-sessions judges each imported session afterwards (ifStale - never duplicates the engine’s own sweep), --dry-run prints payloads without ingesting, --agent-name pins every trace to one agent.

Offline evaluation of a served agent

The agent stays deployed; an AgentX dataset run drives it - see sample-scripts/sdk_eval_samples/databricks_agent_eval.py for the full version:
Cases with expected_tools=[...] are trajectory-matched against the tools the deployed agent actually called, once traces are linked via either path above.