refactor(api): move retention and limits under spec.policy - #9
Merged
Conversation
Nest both under a PolicySpec mapping 1:1 onto oteldb's storage.policy, so the remaining policies (precision, downsample, recompress) have an obvious home when they land. See #3. Document that oteldb gained storage.policy.retention/limits after v0.48.0: older builds ignore unknown config keys, so the policy silently does nothing against them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Add spec.policy.downsample, .precision and .recompress, completing the CRD's coverage of oteldb's storage.policy. All three work against the released v0.48.0, unlike retention and limits. Reject tiers the engine would ignore — duplicate after values, a non-positive downsample interval or recompress after, and any tier at or past retention.maxAge. Downsample and precision rewrite parts irreversibly, so a tier that silently does nothing is worth failing over. With the block modelled in full, all of storage.policy is now reserved in extraConfig. Closes #3 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
feat(api): model the merge-time policy tiers
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.
Follow-up to #7/#8: nests the freshly-added
retentionandlimitsunder aspec.policyblock that maps 1:1 onto oteldb'sstorage.policy, as proposed in #3.The point is that
precision,downsampleandrecompress— the rest of #3 — now have an obvious home, instead of accumulating as more top-level siblings. This is a breaking change tov1alpha1, which is why it's worth doing immediately:spec.retention/spec.limitsshipped hours ago, so nothing should be relying on them yet.Reserved-path hints move with the fields (
use spec.policy.retention/use spec.policy.limits);precision/downsample/recompressstay mergeable throughextraConfig.Version caveat, now documented
storage.policy.retentionandstorage.policy.limitsare on oteldbmain(oteldb/oteldb@22567d12, closing oteldb/oteldb#1195) but are not in any release — the newest tag, v0.48.0, predates them. oteldb does not decode its config strictly, so against every released build today, including the operator's defaultv0.46.0image, these fields are accepted and silently do nothing.That's the exact failure mode #2 was about, so it's now called out in the
PolicySpecgodoc, the README and the sample rather than left for a user to discover. Once oteldb cuts a tag, the default image bump makes it work with no API change.Verification
make testpasses at 86.9% coverage,make lintreports 0 issues,make manifests generate && go mod tidyleaves the tree clean.Also removed two stale deregistered agent worktrees under
.claude/worktrees/(untracked, not part of this diff) that were making golangci-lint's generated-file filter fail and surface spuriouszz_generated.deepcopy.gofindings.🤖 Generated with Claude Code