Langfuse retention settings #2268
Replies: 6 comments 4 replies
-
Agree, with the migration to Langfuse v3, setting expiration dates on single rows will become simpler to handle data retention at scale in langfuse. Thanks for raising this! |
Beta Was this translation helpful? Give feedback.
-
If there is a safe way to delete traces from PostgreSQL in current v2 setup could you please share from which tables can we manually delete records? are they connected with foreign keys with cascading deletetion feature or we have to manually delete some disconnected remnants? |
Beta Was this translation helpful? Give feedback.
-
I am also interested in this. Folks in my org would like to be able to limit data storage to 24 hours to comply with regulations. LangSmith has this feature: https://docs.smith.langchain.com/self_hosting/configuration/ttl |
Beta Was this translation helpful? Give feedback.
-
Quick update on this thread, retention capabilities will be added in the upcoming v3 of Langfuse as a project-level setting. Langfuse CloudIf you run on Langfuse Cloud, please reach out to us and we can manage retention settings for you project on our end internally. Self-hostedIf you run self-hosted, you can safely delete data from the following tables: DELETE FROM traces
WHERE "timestamp" < '2024-08-01' DELETE FROM observations
WHERE "start_time" < '2024-08-01' DELETE FROM scores
WHERE "timestamp" < '2024-08-01' You can easily run these queries on a cron schedule. If you db is huge, please keep in mind that vacuuming might impact db performance while it is happening. Q&A
No foreign key constraints are applied that would block a deletion of records. Background: Records need to be compliant with data privacy regulation as well as data needs to be ingested into langfuse without a constraint on the order of records. |
Beta Was this translation helpful? Give feedback.
-
Thank you, @marcklingen for sharing options.I am closing this thread for now. |
Beta Was this translation helpful? Give feedback.
-
are you not creating these tables partitioned by date? can't we just drop the older partitions? |
Beta Was this translation helpful? Give feedback.
-
Describe the feature or potential improvement
Thanks for providing this great tool, a feature could be a retention settings for trace purge automatically like all traces > 30 days old.
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions