feat(api): add opt-in spec.ingest.tenant write routing - #20
Draft
tdakkota wants to merge 2 commits into
Draft
Conversation
Mirrors odbingest's tenant block (header, resource_attributes, default, require) onto the CRD, and validates what odbingest would otherwise crash-loop on at startup. It stays off by default, and the field docs say why: oteldb's read path is still pinned to one tenant — the query Backend's tenant id is never assigned, so every query resolves "default" (oteldb#820). Enabling ingest-side tenancy today routes writes into tenants nothing can query. Absent renders no tenant block at all, byte-identical to today.
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.
Adds
spec.ingest.tenant, mirroring the opt-intenant:block odbingest gained inoteldb#1280 —
{header, resourceAttributes, default, require}, composing narrowest-first (header ▸ resource attribute ▸ default).It is off by default, and that is the point
oteldb's read path is still pinned to a single tenant.
storagebackend.Backend.tenantis neverassigned — there is no option or setter for it — so it stays
""and normalizes to"default"onevery read; every PromQL, LogQL, TraceQL and Pyroscope query resolves that one tenant
(oteldb#820).
So enabling ingest-side tenancy today routes writes into tenants nothing can query. The data is
stored, under a different shard key, and is invisible until the read path catches up. The field
needs to exist so the deployment is configurable ahead of that — but the default must stay today's
behaviour, and the godoc on
IngestSpec.TenantandTenantSpecsays so explicitly, as does theREADME's new Ingest tenancy section.
Absent renders no
tenantblock at all, byte-identical to what an ingest pool got before thisfield existed: odbingest installs no resolver and every write lands in
"default".Validation
Each check mirrors
cmd/odbingest'snewTenantResolver/parseTenantID, because odbingest failsthese at startup — a
Degraded/InvalidSpeccondition naming the field is a better report than acrash-looping Deployment:
requirewithoutheader— there is no header to require.resourceAttributes.defaultthat is not a legal tenant id (charset, 150-byte bound,./..) — the id becomes abackend path segment and an etcd key component.
present and inert.
tenantalso joinsspec.ingest.extraConfig's reserved paths, since the block is now modelled infull.
Stack
Based on #19 (
spec.policy.ec) → #17 (spec.cluster.privateBackend) → #15 (spec.query) → #14(
spec.ingest). The dependency on #14 is real —IngestSpecis where the field lives; the rest isstack ordering.