Use per-collector retention from collection_schedule (#237)#239
Merged
erikdarlingdata merged 1 commit intodevfrom Feb 23, 2026
Merged
Use per-collector retention from collection_schedule (#237)#239erikdarlingdata merged 1 commit intodevfrom
erikdarlingdata merged 1 commit intodevfrom
Conversation
…etention (#237) The data retention procedure now reads retention_days from config.collection_schedule for each table instead of using a hardcoded 30-day value. Direct name matching handles most tables; special mappings cover HealthParser, blocking_BlockedProcessReport, and deadlocks tables. The @retention_days parameter remains as a fallback for unmatched tables. The SQL Agent job step no longer passes @retention_days = 30, letting the procedure use per-collector settings by default. Tested on sql2022: query_snapshots used 10-day retention, running_jobs used 7-day retention, batch deletion confirmed working with @batch_size = 1000. Closes #237 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
config.data_retentionnow readsretention_daysfromconfig.collection_scheduleper collector instead of using a hardcoded 30-day value_collector/_analyzersuffix) handles most tables; special mappings cover HealthParser, blocking_BlockedProcessReport, and deadlocks@retention_daysparameter remains as fallback for any unmatched tables@retention_days = 30Test plan
@debug = 1— query_snapshots used 10-day, running_jobs used 7-day retention@batch_size = 1000: 29 batches of 1000 + final batch of 5 for wait_statsCloses #237
🤖 Generated with Claude Code