test(compat/loki): pin k8s-family stream labels (pod/namespace/service_name/cluster/container) in seeder#715
Closed
tsouza wants to merge 1 commit into
Closed
test(compat/loki): pin k8s-family stream labels (pod/namespace/service_name/cluster/container) in seeder#715tsouza wants to merge 1 commit into
tsouza wants to merge 1 commit into
Conversation
…n seeder The four "Plain seed-gap" rows in cerberus-test-queries.yml that PR #712 retires (exhaustive/aggregations.yaml#Count aggregated by pod / namespace / service_name / cluster and namespace / service_name and container, plus exhaustive/unwrap-aggregations.yaml#Without multiple labels) require the seeder to write the five k8s-family labels (pod, namespace, service_name, cluster, container) into both: - the pushLoki stream label set (so the reference Loki indexes the stream under each key), AND - the insertCHLogs ResourceAttributes map (so cerberus's LogQL group-by lowering resolves ResourceAttributes[<key>] to the matching per-stream value via logql.levelAwareGroupKey). The shape was already correct after PR #525 hoisted the stream-identity labels into ResourceAttributes; this commit pins it so a future trim of the seed map fails at unit-test review rather than on the compatibility lane (which is where every previous regression of this shape surfaced). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Owner
Author
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.
Summary
PR #712 retires the historic
cerberus-test-queries.ymlshould_skipoverlay, surfacing four "Plain seed-gap" rows whose rationale comments pinned them to the seeder missing the five k8s-family stream labels:exhaustive/aggregations.yaml#Count aggregated by podexhaustive/aggregations.yaml#Count aggregated by namespaceexhaustive/aggregations.yaml#Count aggregated by service_nameexhaustive/aggregations.yaml#Count aggregated by cluster and namespaceexhaustive/aggregations.yaml#Count aggregated by service_name and containerexhaustive/unwrap-aggregations.yaml#Without multiple labels(sum without (namespace, cluster))Investigation: the seeder's shape has been correct since PR #525 hoisted the stream-identity labels into ResourceAttributes. All five required keys are present in both the pushLoki stream label set (so reference Loki indexes the streams) and the insertCHLogs ResourceAttributes map (so cerberus's LogQL group-by lowering resolves
ResourceAttributes[<key>]vialogql.levelAwareGroupKey). Theshould_skiprationale comments were stale — they survived past PR #525 without re-validation.This PR pins the shape with a unit-level regression test (
TestSeederWritesK8sStreamLabels) so any future trim of the seed map surfaces at PR-review time rather than on the compatibility lane (which is where every previous regression of this shape was caught). The seeder itself gains clarifying comments at both call sites (buildStreamsfor the Loki push,insertCHLogsfor the CH-side ResourceAttributes) tying each call-site to the corpus rows it underpins.What the test asserts
For every stream produced by
buildStreams:pod,namespace,service_name,cluster,container) with non-empty values.insertCHLogsResourceAttributes map (re-built from the sameserviceConfig) has all five required keys with non-empty values.Labels touched + how
podnamespaceservice_nameclustercontainerNo values change. The seeder shape is identical pre/post this PR; only the comments and the test are new.
Test plan
checkrunsTestSeederWritesK8sStreamLabelsand it passes.compatibility/lokiruns the four corpus rows above without the retiredshould_skipoverlay and the differ reports parity (depends on PR chore(tests): delete every test-suite escape-hatch / allowlist mechanism #712 landing first; this PR is the seeder-side guarantee that closes the diagnosis loop).forbid-skip,lint,compose-smokestay green — no source changes outside the compat-loki seeder package.🤖 Generated with Claude Code