Selective deletion of traces with associated observations older than 7 days by trace name and project #10660
Replies: 2 comments
-
|
For selective deletion of traces older than 7 days filtered by trace name and project in your self-hosted Langfuse v3.132.0 deployment, you have several options: Deletion MethodsDelete by Query (UI)(1) API-Based Deletion(1)
Important LimitationsDeletion is Not Instantaneous(1) Data Retention Feature(2) Alternative Approaches for OSS UsersAccording to community discussions, for self-hosted OSS users without access to automated data retention, you would need to implement your own solution(3). This could involve writing SQL scripts or cron jobs to remove records older than 7 days directly from your database, ensuring you handle related data (like observations and scores) to maintain referential integrity(3). Performance ConsiderationsIf slow queries are your primary concern, the documentation also recommends reviewing your ClickHouse instance size and ensuring time filters are applied, as tracing data is indexed by projectId and time(4). Adding filter conditions on these should significantly improve performance(4). For larger deployments, at least 16 GiB of memory is recommended for ClickHouse(4). Note: There is no built-in feature in the OSS version to selectively retain certain traces while automatically deleting others based on custom criteria like trace name. You would need to implement custom logic using the deletion APIs or database scripts. 📚 Sources:
Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Haoping-Xiao, was Inkeep's answer helpful for you? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe your question
We are currently storing a large number of traces in Langfuse for logging purposes. The growing volume of data has made queries on our self-hosted ClickHouse cluster extremely slow. I would like to selectively delete traces, along with their associated observations, that are older than 7 days, filtered by trace name and project. At the same time, I need to retain certain traces for collecting training data. What is the recommended approach to achieve this?
Langfuse Cloud or Self-Hosted?
Self-Hosted
If self-hosted, what version are you running?
3.132.0
SDK and integration versions
No response
Pre-Submission Checklist
Beta Was this translation helpful? Give feedback.
All reactions