Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
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
- Query traces via SDK - Search for traces before deletion to verify your criteria
- Tracing data model - Understand what data is removed when deleting traces
- Build evaluation datasets - Preserve important traces as datasets before deletion