Self-hosted Enterprise customers: You can configure extended data retention at the workspace level through the UI. No environment variable changes are required. See Customize extended retention policy. The system-wide TTL configuration on this page is still supported.
TTL configuration precedence
LangSmith determines how long to keep a trace in two steps: which retention tier the trace belongs to, and what period applies to that tier. LangSmith assigns the tier in the following order, highest precedence first:- Trace upgrade: A run rule or other qualifying action promotes an individual trace to
longlived, overriding whatever tier would otherwise apply. - Project tier: The tier configured for the tracing project.
- Workspace default: New projects inherit this tier. Changing it affects new projects only unless you apply it to all existing projects.
- Organization default: Applies to workspaces with no default of their own.
shortlived: The fallback when no default is set.
longlived: The workspace extended retention period (if set through the UI), otherwise thelonglivedvalue from the Helm configuration.shortlived: Theshortlivedvalue from the Helm configuration.
shortlived and 400 days for longlived.
Requirements
Configure retention through Helm or environment variable settings:- Enabled: Enable or disable automatic data retention. When enabled, set your default organization and project TTL tiers through the UI (see data retention guide).
- Retention periods: Set system-wide retention periods for
shortlivedandlonglivedtraces. Once set, manage retention at the project level or set an organization-wide default for new projects.
Helm
ClickHouse TTL cleanup job
As of version 0.11, a cron job runs on weekends to delete expired data that ClickHouse’s built-in TTL mechanism may not have cleaned up.Default schedule
By default, the cleanup job runs:- Saturday: 8pm and 10pm UTC.
- Sunday: 12am, 2am, and 4am UTC.
Disabling the job
To disable the cleanup job entirely:Configuring the schedule
Customize when the cleanup job runs by modifying the cron expressions:Configuring minimum expired rows per part
The job works through the tables one at a time. Within each table it scans the parts and deletes data from any part holding at least a minimum number of expired rows. This threshold balances efficiency and thoroughness:- Too low: The job scans entire parts to clear minimal data (inefficient).
- Too high: The job skips parts with significant expired data.
Checking expired rows
Run this query to see expired rows per table part, then tune your minimum value:Configuring maximum active mutations
Delete operations can take around 50 minutes for a 100 GB part. Increase concurrent mutations to speed up cleanup:Emergency: Stopping running mutations
If you see latency spikes and need to stop a running mutation:-
Find active mutations:
Find the
mutation_idwhere thecommandcolumn contains aDELETEstatement. -
Kill the mutation:
Backups and data retention
If disk space does not decrease after the job runs, or keeps growing, backups may be the cause. Backup processes create filesystem hard links that prevent ClickHouse from releasing data. Check these directories inside your ClickHouse pod:/var/lib/clickhouse/backup/var/lib/clickhouse/shadow
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

