Skip to main content

Delete Traces

You can delete traces based on specific criteria using the mlflow.client.MlflowClient.delete_traces method. This method allows you to delete traces by experiment ID, maximum timestamp, or request IDs.

tip

Deleting a trace is an irreversible process. Ensure that the setting provided within the delete_traces API meet the intended range for deletion.

Python
import time

# Get the current timestamp in milliseconds
current_time = int(time.time() * 1000)

# Delete traces older than a specific timestamp
deleted_count = client.delete_traces(
experiment_id="1", max_timestamp_millis=current_time, max_traces=10
)

Next Steps