Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds automated data retention management for Langfuse traces stored in ClickHouse, targeting deployments without Langfuse Enterprise's built-in retention features. The implementation uses Kubernetes CronJobs to apply TTL policies and optionally perform hard deletes on Langfuse trace tables.
Changes:
- Added
langfuseRetentionconfiguration section in values.yaml with configurable retention period, schedules, and ClickHouse table mappings - Created two CronJob templates: one for applying TTL policies and another for deterministic hard deletes
- Implemented a shared Helm helper template for consistent ClickHouse connection configuration across retention jobs
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| infrastructure/rag/values.yaml | Adds langfuseRetention configuration section with retention settings, CronJob schedules, image configuration, and ClickHouse table mappings |
| infrastructure/rag/templates/langfuse-retention-cronjob.yaml | Implements CronJob for applying idempotent TTL policies to Langfuse tables using ALTER TABLE MODIFY TTL |
| infrastructure/rag/templates/langfuse-retention-hard-delete-cronjob.yaml | Implements optional CronJob for hard deletion of expired rows using ALTER TABLE DELETE WHERE with configurable mutation sync |
| infrastructure/rag/templates/_helpers.tpl | Adds shared template for ClickHouse connection environment variables used by both retention CronJobs |
| infrastructure/README.md | Documents the new trace retention feature with configuration examples and operational notes for non-Enterprise users |
infrastructure/rag/templates/langfuse-retention-hard-delete-cronjob.yaml
Show resolved
Hide resolved
infrastructure/rag/templates/langfuse-retention-hard-delete-cronjob.yaml
Outdated
Show resolved
Hide resolved
infrastructure/rag/templates/langfuse-retention-hard-delete-cronjob.yaml
Show resolved
Hide resolved
robodev-r2d2
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for automated data retention for Langfuse traces in ClickHouse, targeting setups that do not use Langfuse Enterprise's built-in data retention. It adds Helm chart options, Kubernetes CronJobs for both TTL enforcement and hard deletes, as well as shared environment configuration for ClickHouse access. The documentation is also updated to explain these new features.
Langfuse Trace Retention Automation
langfuseRetentionconfiguration section invalues.yamlto enable and customize automatic trace retention, including TTL and optional hard deletion, with customizable schedules and ClickHouse table/column mapping.ALTER TABLE ... MODIFY TTLstatements for automatic data expiration.ALTER TABLE ... DELETE WHERE ..., with mutation sync settings.rag.langfuseRetentionClickhouseEnv) to inject consistent ClickHouse connection and retention settings into the CronJobs' environment.Documentation
README.mdto document the new trace retention options, configuration examples, and operational notes for non-Enterprise users.