Skip to content

feat(api): add spec.retention and spec.limits - #7

Merged
tdakkota merged 2 commits into
fix/extraconfig-deep-mergefrom
feat/retention-limits
Jul 28, 2026
Merged

feat(api): add spec.retention and spec.limits#7
tdakkota merged 2 commits into
fix/extraconfig-deep-mergefrom
feat/retention-limits

Conversation

@tdakkota

Copy link
Copy Markdown
Contributor

Models oteldb's storage.policy.retention and storage.policy.limits in the CRD, so retention no longer has to go through extraConfig.

Note

Stacked on #6 — the reserved-path guard it adds is what these two new paths plug into. Base retargets to main automatically once #6 merges.

API

spec:
  retention:
    maxAge: 720h
    maxBytes: 500Gi     # accepted, not enforced upstream yet
  limits:
    ingestBytesPerSecond: 50Mi
    maxInFlightBytes: 1Gi
    maxSeries: 2000000
    maxSeriesSoft: 1500000
    maxPartSize: 256Mi

Renders to storage.policy.{retention,limits}. Neither field set ⇒ no policy block 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.maxBytes is 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 only maxBytes would otherwise think their disk is bounded.

Validation

validatePolicy runs alongside validateSignals in renderConfig and returns the validationError from #6, so a bad policy lands as Degraded/InvalidSpec without requeue:

  • negative durations/quantities (zero stays the documented "unlimited")
  • maxSeriesSoft without maxSeries, or above it — a soft budget over the hard ceiling never engages, because the hard limit sheds first

Reserved paths

storage.policy.retention and storage.policy.limits join reservedConfigPaths. 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 StoragePolicyConfig structs (duration as "720h0m0s", byte budgets as integers) rather than assumed to parse.

make test passes at 86.9% coverage (up from 85.0%), make lint reports 0 issues, and make manifests generate && go mod tidy leaves the tree clean.

🤖 Generated with Claude Code

tdakkota and others added 2 commits July 28, 2026 14:50
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>
@tdakkota
tdakkota merged commit f62647c into fix/extraconfig-deep-merge Jul 28, 2026
5 checks passed
@tdakkota
tdakkota deleted the feat/retention-limits branch July 28, 2026 12:56
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