MlflowTraceProcessor implements the TraceProcessor ABC and streams QitOS run data to an MLflow tracking server. Once attached, it automatically logs per-span metrics during the run and writes a final summary when the trace ends.
Installation
mlflow SDK as an optional dependency. Without it, importing MlflowTraceProcessor raises an ImportError.
Quick start
MlflowTraceProcessor calls mlflow.set_experiment() and mlflow.start_run() with the provided arguments. When the trace ends (either normally or on error), it writes a summary and calls mlflow.end_run() by default.
Constructor parameters
What gets logged
Per-span metrics
The processor intercepts span-end events and logs metrics incrementally during the run.
Tool names and action names are recorded as MLflow tags rather than metrics, since they are string values.
Final summary
When the trace ends, the processor writes aggregate metrics to the MLflow run:Using with a local tracking server
Start an MLflow tracking server locally, then point the processor at it:tracking_uri is not set, MLflow defaults to the local mlruns directory.
Combining with other processors
add_trace_processor appends to the global processor list, so you can combine MlflowTraceProcessor with any other TraceProcessor, including WandbTraceProcessor:
set_trace_processors:
Lifecycle control
auto_end_run
By default,auto_end_run=True and the processor calls mlflow.end_run() automatically when on_trace_end fires. Set auto_end_run=False if you want to continue logging custom metrics to the same MLflow run after the QitOS trace ends:
shutdown()
Callshutdown() to close the MLflow run early (for example, on SIGTERM or in a notebook cleanup step):
mlflow.end_run() if a run is active and auto_end_run is True. It is safe to call multiple times.
force_flush()
Callforce_flush() to ensure all buffered metrics are written to the MLflow tracking server:
