feat(api): add spec.retention and spec.limits - #7
Merged
Conversation
Model oteldb's storage.policy.retention (max_age, max_bytes) and storage.policy.limits (ingest rate, in-flight bytes, series cardinality, part size) instead of leaving them to extraConfig. Both paths join reservedConfigPaths; the rest of storage.policy stays mergeable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <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.
Models oteldb's
storage.policy.retentionandstorage.policy.limitsin the CRD, so retention no longer has to go throughextraConfig.Note
Stacked on #6 — the reserved-path guard it adds is what these two new paths plug into. Base retargets to
mainautomatically once #6 merges.API
Renders to
storage.policy.{retention,limits}. Neither field set ⇒ nopolicyblock at all, which is oteldb's "install no tenancy resolver" default (retain forever, no limits) — so this is a no-op for existing clusters.Field names mirror the upstream config keys 1:1 to keep the mapping obvious.
retention.maxBytesis accepted by oteldb but not enforced by the storage engine yet (oteldb/storage#224); the godoc, the README and the sample all say so, since a user setting onlymaxByteswould otherwise think their disk is bounded.Validation
validatePolicyruns alongsidevalidateSignalsinrenderConfigand returns thevalidationErrorfrom #6, so a bad policy lands asDegraded/InvalidSpecwithout requeue:maxSeriesSoftwithoutmaxSeries, or above it — a soft budget over the hard ceiling never engages, because the hard limit sheds firstReserved paths
storage.policy.retentionandstorage.policy.limitsjoinreservedConfigPaths. The siblings the CRD does not model —precision,downsample,recompress— stay mergeable, and there's a test pinning that.Verification
The rendered forms were decoded against oteldb's actual
StoragePolicyConfigstructs (duration as"720h0m0s", byte budgets as integers) rather than assumed to parse.make testpasses at 86.9% coverage (up from 85.0%),make lintreports 0 issues, andmake manifests generate && go mod tidyleaves the tree clean.🤖 Generated with Claude Code