Skip to content

vmcluster/vmsingle: support downsampling and retention filters#2224

Open
AndrewChubatiuk wants to merge 1 commit into
masterfrom
support-downsampling-and-retention-filters
Open

vmcluster/vmsingle: support downsampling and retention filters#2224
AndrewChubatiuk wants to merge 1 commit into
masterfrom
support-downsampling-and-retention-filters

Conversation

@AndrewChubatiuk
Copy link
Copy Markdown
Contributor

@AndrewChubatiuk AndrewChubatiuk commented May 29, 2026

fixes #2221
related issue VictoriaMetrics/helm-charts#2221


Summary by cubic

Adds structured downsampling and per-series retention filters to VMSingle and VMCluster. The operator validates enterprise settings and renders flags with strict interval rules and correct dedup defaults.

  • New Features

    • spec.downsampling for VMSingle and VMCluster with rules {filter?, periods:[{offset, interval}]} and optional dedupInterval; applied to vmselect and vmstorage.
    • spec.retentionFilters for VMSingle, and spec.vmstorage.retentionFilters for VMCluster.
    • Validation requires enterprise license; parses MetricsQL filters and durations; enforces offset is a multiple of interval; period intervals in a rule are pairwise multiples; dedupInterval must divide all rule intervals; duplicate rule filters are rejected; per-series retention must not exceed spec.retentionPeriod.
    • Controllers emit -downsampling.period per period (prefixed with filter when set), set -dedup.minScrapeInterval from dedupInterval and otherwise default to 1ms only when not provided, and emit -retentionFilter on VMSingle and VMCluster vmstorage.
    • CRDs, deepcopy, tests, and docs updated; examples now use structured fields instead of extraArgs.
  • Migration

    • Prefer spec.downsampling and spec.retentionFilters over extraArgs; set enterprise image/tag and spec.license. Use spec.retentionPeriod for the default retention.

Written for commit a7168d8. Summary will update on new commits.

Review in cubic

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 13 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread internal/controller/operator/factory/vmsingle/vmsingle.go
Comment thread api/operator/v1beta1/vmcluster_types.go
Comment thread api/operator/v1beta1/vmextra_types.go
Comment thread internal/controller/operator/factory/vmcluster/vmcluster.go
@AndrewChubatiuk AndrewChubatiuk force-pushed the support-downsampling-and-retention-filters branch 3 times, most recently from 83b6f64 to 6f7673c Compare May 29, 2026 07:26
@AndrewChubatiuk
Copy link
Copy Markdown
Contributor Author

@cubic-ai-dev

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented May 29, 2026

@cubic-ai-dev

@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 14 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread docs/resources/vmcluster.md
Comment thread docs/resources/vmcluster.md
@AndrewChubatiuk AndrewChubatiuk force-pushed the support-downsampling-and-retention-filters branch from c1e6af7 to a7168d8 Compare June 1, 2026 12:31
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.

feature(vmcluster,vmsingle): support first class downsampling and retention filters management

2 participants