---
type: concept
x-llmwiki:
  schemaVersion: "0.1"
  contentHash: ef2f0950e9a8164825498d17e0c7ded616cc38261dd3233cf0d96fc937f07483
  pageDirectory: concepts
  sources:
    - opentelemetry-export-databricks-on-aws.md
  confidence: 0.98
  provenanceState: extracted
  freshnessStatus: unverified
  aliases:
    - mlflow-trace-export-modes
    - MTEM
  citations:
    - file: opentelemetry-export-databricks-on-aws.md
title: MLflow Trace Export Modes
description: "MLflow supports three trace export modes: MLflow Tracking Server only, OpenTelemetry Collector only, or dual export to both simultaneously."
tags:
  - export
  - MLflow
  - configuration
timestamp: "2026-06-19T19:50:57.512Z"
---

# MLflow Trace Export Modes

**MLflow Trace Export Modes** define how traces generated by [MLflow](/concepts/mlflow.md) are routed to external systems for observability and monitoring. Because MLflow traces are compatible with the OpenTelemetry trace specification, they can be exported to various observability solutions that support OpenTelemetry. ^[opentelemetry-export-databricks-on-aws.md]

## Available Export Modes

MLflow supports three export modes for traces: ^[opentelemetry-export-databricks-on-aws.md]

1. **MLflow tracking only (Default)**: Traces are sent only to the MLflow Tracking Server.
2. **OpenTelemetry only**: Traces are sent only to an OpenTelemetry Collector.
3. **Dual export**: Traces are sent to both MLflow Tracking and an OpenTelemetry Collector.

## MLflow Tracking Only (Default)

By default, MLflow exports traces exclusively to the [MLflow Tracking Server](/concepts/remote-mlflow-tracking-server.md). No additional configuration is required for this mode — it is the standard behavior when no OpenTelemetry exporter environment variables are set. ^[opentelemetry-export-databricks-on-aws.md]

## OpenTelemetry Only

To export traces *only* to an OpenTelemetry Collector, set the `OTEL_EXPORTER_OTLP_ENDPOINT` (or `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`) environment variable to the target URL of the OpenTelemetry Collector *before starting any trace*. ^[opentelemetry-export-databricks-on-aws.md]

```python
import os
os.environ["OTEL_EXPORTER_OTLP_TRACES_ENDPOINT"] = "http://localhost:4317/v1/traces"
os.environ["OTEL_SERVICE_NAME"] = "<your-service-name>"
```

When configured this way, traces are sent exclusively to the specified OpenTelemetry endpoint, bypassing MLflow Tracking. ^[opentelemetry-export-databricks-on-aws.md]

## Dual Export (MLflow + OpenTelemetry)

Dual export sends traces to *both* Databricks MLflow and an OpenTelemetry service simultaneously. This mode enables using MLflow's tracking capabilities alongside existing observability infrastructure without choosing between them. ^[opentelemetry-export-databricks-on-aws.md]

### Enable Dual Export

To enable dual export, set the `MLFLOW_ENABLE_DUAL_EXPORT` environment variable to `"true"` along with your OpenTelemetry configuration: ^[opentelemetry-export-databricks-on-aws.md]

```python
import os
os.environ["MLFLOW_ENABLE_DUAL_EXPORT"] = "true"
os.environ["OTEL_EXPORTER_OTLP_TRACES_ENDPOINT"] = "http://localhost:4317/v1/traces"
os.environ["OTEL_SERVICE_NAME"] = "my-ml-service"
mlflow.set_tracking_uri("databricks")
```

After configuration, all traces are exported to both MLflow and the configured OpenTelemetry Collector. ^[opentelemetry-export-databricks-on-aws.md]

## Metrics Export

MLflow can also export OpenTelemetry metrics when a metrics endpoint is configured, enabling monitoring of span durations and other trace-related metrics in compatible monitoring systems. ^[opentelemetry-export-databricks-on-aws.md]

### Enable Metrics Export

To export metrics to an OpenTelemetry Collector, set the following environment variables: ^[opentelemetry-export-databricks-on-aws.md]

```python
os.environ["OTEL_METRICS_EXPORTER"] = "otlp"
os.environ["OTEL_EXPORTER_OTLP_METRICS_ENDPOINT"] = "http://localhost:4317"
os.environ["OTEL_METRIC_EXPORT_INTERVAL"] = "60000"  # Export every 60 seconds
```

For a complete list of exported metrics, see MLflow Exported Metrics Documentation. ^[opentelemetry-export-databricks-on-aws.md]

## OpenTelemetry Collector Configuration

MLflow uses the standard OTLP Exporter for exporting traces to OpenTelemetry Collector instances. All standard OpenTelemetry OTLP exporter configurations are supported, including custom protocols and headers: ^[opentelemetry-export-databricks-on-aws.md]

```bash
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://localhost:4317/v1/traces"
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_TRACES_HEADERS="api_key=12345"
```

## Related Concepts

- [MLflow Tracing](/concepts/mlflow-tracing.md) — Overview of MLflow's tracing capabilities
- OpenTelemetry Integration — How MLflow integrates with OpenTelemetry
- [OpenTelemetry Collector Setup](/concepts/opentelemetry-collector-configuration-for-mlflow.md) — Setting up collectors for specific observability platforms
- Production Tracing — Using exported traces for production monitoring
- [MLflow Tracking Server](/concepts/remote-mlflow-tracking-server.md) — The default destination for MLflow traces
- OTLP Exporter Configuration — All supported OTLP exporter settings

## Sources

- opentelemetry-export-databricks-on-aws.md

# Citations

1. [opentelemetry-export-databricks-on-aws.md](/references/opentelemetry-export-databricks-on-aws-d0c0ee4c.md)
