feat(api): model the merge-time policy tiers - #10
Merged
Conversation
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) <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.
Completes the CRD's coverage of oteldb's
storage.policywith the three merge-time tiers, closing out #3.Note
Stacked on #9 (which introduces
spec.policy). Base retargets tomainonce #9 merges.Unlike
retention/limits, all three work against released oteldb — they're in v0.48.0'sStoragePolicyConfig. I verified the rendered YAML decodes through v0.48.0'stenancyOption(soagg: avgreally parses), not just against oteldbmain.Validation
Both tier lists are order-independent upstream — a sample takes the coarsest tier whose
afterit passed — so the CRD doesn't enforce ordering. It does reject tiers the engine would ignore:afterwithin a list (one of the two tiers is dead)downsample[].interval, orrecompress.after(the block exists only to enable it)retention.maxAge— merge work whose output is dropped before it can be readThat last one only applies to a real window;
maxAge: 0is "retain forever" and doesn't bound anything.downsampleandprecisionrewrite parts in place and cannot be undone — lowering anafterre-processes existing data at the next merge and the discarded samples/mantissa bits are gone. That's why a silently-inert tier is worth failing the reconcile over, and it's called out in the field godoc, the README and the sample.recompressis lossless and decode-transparent, so it's documented as the safe one.Reserved paths
storage.policyis now modelled in full, so all five keys are reserved inextraConfig. Three existing tests usedstorage.policy.recompressas their "non-reserved" example and now usestorage.log_query_parallelism, a real oteldb key the CRD still doesn't model. The README'sextraConfigexample moved offrecompressfor the same reason.Verification
make testpasses at 88.4% coverage (up from 86.9%),make lintreports 0 issues,make manifests generate && go mod tidyleaves the tree clean.Closes #3
🤖 Generated with Claude Code