Skip to content

refactor(api): move retention and limits under spec.policy - #9

Merged
tdakkota merged 5 commits into
mainfrom
refactor/policy-spec
Jul 28, 2026
Merged

refactor(api): move retention and limits under spec.policy#9
tdakkota merged 5 commits into
mainfrom
refactor/policy-spec

Conversation

@tdakkota

Copy link
Copy Markdown
Contributor

Follow-up to #7/#8: nests the freshly-added retention and limits under a spec.policy block that maps 1:1 onto oteldb's storage.policy, as proposed in #3.

spec:
  policy:
    retention:
      maxAge: 720h
    limits:
      maxSeries: 2000000
      maxSeriesSoft: 1500000

The point is that precision, downsample and recompress — the rest of #3 — now have an obvious home, instead of accumulating as more top-level siblings. This is a breaking change to v1alpha1, which is why it's worth doing immediately: spec.retention/spec.limits shipped 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/recompress stay mergeable through extraConfig.

Version caveat, now documented

storage.policy.retention and storage.policy.limits are on oteldb main (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 default v0.46.0 image, 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 PolicySpec godoc, 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 test passes at 86.9% coverage, make lint reports 0 issues, make manifests generate && go mod tidy leaves 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 spurious zz_generated.deepcopy.go findings.

🤖 Generated with Claude Code

tdakkota and others added 4 commits July 28, 2026 16:32
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]>
feat(api): model the merge-time policy tiers
@tdakkota
tdakkota merged commit 547dd6e into main Jul 28, 2026
5 checks passed
@tdakkota
tdakkota deleted the refactor/policy-spec branch July 28, 2026 14: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