Skip to content

Use per-collector retention from collection_schedule (#237)#239

Merged
erikdarlingdata merged 1 commit intodevfrom
feature/per-collector-retention-237
Feb 23, 2026
Merged

Use per-collector retention from collection_schedule (#237)#239
erikdarlingdata merged 1 commit intodevfrom
feature/per-collector-retention-237

Conversation

@erikdarlingdata
Copy link
Owner

Summary

  • config.data_retention now reads retention_days from config.collection_schedule per collector instead of using a hardcoded 30-day value
  • Direct name matching (strip _collector/_analyzer suffix) handles most tables; special mappings cover HealthParser, blocking_BlockedProcessReport, and deadlocks
  • @retention_days parameter remains as fallback for any unmatched tables
  • SQL Agent job step no longer passes @retention_days = 30

Test plan

  • Tested mapping logic: all 53 collect tables matched to their collector, zero false positives
  • Deployed and ran on sql2022 with @debug = 1 — query_snapshots used 10-day, running_jobs used 7-day retention
  • Batch deletion verified with @batch_size = 1000: 29 batches of 1000 + final batch of 5 for wait_stats

Closes #237

🤖 Generated with Claude Code

…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>
@erikdarlingdata erikdarlingdata merged commit 70cf137 into dev Feb 23, 2026
7 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/per-collector-retention-237 branch February 23, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant