test(e2e): tighten Test 3's wire-shape requirements + document deeper gap - #250
Merged
Merged
Conversation
… gap Investigation following #249 (L5-walk fix) clarified two more ingest-path requirements that were silently dropping the OTLP DPs even after the streaming-config JSON shape was correct: 1. **OTLP DP needs at least one attribute (or known sid).** With both empty, the receiver hits the "invalid wire shape" drop in `route_modified_otlp_sketches_to_precompute` (per the comment block at otel.rs:926 — `(sid=0, no attrs)` is dropped). Test 3 now attaches `service="e2e-test"` to the DP; with this, the resolver mints a sid and the sketch state lands in `SketchStore`. 2. **The DP's `group_by_keys` (from `dp.attrs.keys()`) must EXACTLY match the streaming-config policy's `grouping_labels`** for `find_policy_by_content` to bind `policy_fp` to the registered sid. The match is **strict** at ingest (asap_tier_analysis.rs:525) but **subset** at query time (asap_tier_analysis.rs:587) — that asymmetry is intentional (ingest needs uniqueness; queries can re-aggregate down). Test 3 now uses `group_by_labels: ["service"]` in the workload so the streaming-config grouping aligns with the DP's attrs. After both alignments, the runtime-info endpoint shows the sketch state DID land in `SketchStore` (`earliest_timestamp_per_sid` is populated). The query nevertheless still returns `bad_data` / "No result for query" — there's a remaining gap between `SketchStore::instances_matching` and the engine's reducer dispatch. Untangling that needs deeper engine-path tracing (likely a candidate. required_capability vs policy_capability asymmetry, or a sid-by-policy_fp reverse-index lookup failure). This PR captures the findings as comments and tightens the test's wire-shape requirements so the next investigation starts from a realistic OTLP DP shape rather than the minimal "invalid wire shape" one. The query soft-check (status field exists, value not asserted) remains in place. Tightening to `status == "success"` plus an exact-value-within-SLA check on the returned quantile is what remains for whoever closes the engine-path gap. Tests: 3/3 pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
zzylol
added a commit
that referenced
this pull request
May 15, 2026
…re (#251) Mirrors #244 / #246 / #250's PR-5 wire-cleanup pattern, now for the edge-side runtime emitters. The patched asap-otel processors (any runtime — OTel collector / OTAP / Telegraf) don't consume the controller-allocated `aggregation_id` string: sid identity is content-addressed at the backend via `(metric_name, attrs_fingerprint, agg_kind_canonical)`, and `policy_fp` content- matches via `(metric, sketch_kind, config, group_by_keys)`. The controller-allocated string is dead weight on the wire. The OTel-collector YAML emitter (`emit_edge_yaml`) was already clean — there's an existing test at stage_config.rs asserting the agent YAML does NOT contain `aggregation_id:`. This PR catches the two remaining edge-runtime emitters that still spelled it out: - `emit/otap.rs::build_asap_sketches_config` (line ~287): drop the `aggregation_id` map entry; keep `sketch_kind` etc. - `emit/telegraf.rs::emit_processors_allsketches` (line ~158): drop the `aggregation_id = "…"` TOML line; keep `sketch_kind`. `EdgeSketchProcessor.aggregation_id` stays on the struct as internal emitter plumbing for cross-stage references during the DAG walk (`SketchAgg → BackendAggregation → BackendReadout`); it just doesn't reach the wire from any runtime emitter anymore. Tests: 690 lib + 27 binary tests pass. (No test asserted the field was present in OTAP / Telegraf output, so nothing to flip.) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
zzylol
added a commit
that referenced
this pull request
May 15, 2026
…itations (#252) Engine-path debug session diagnosis (post-#247 → #248 → #249 → #250). The query layer's "No result for query" symptom for sketch-backed metrics has a precise root cause: `query_precomputes_by_agg` (called unconditionally by `execute_store_query`) filters its candidate-sid scan with `matches!(&m.agg_kind, AggKind::ExactAgg { … })` — never matching `AggKind::Sketch`. Since OTLP-arriving DDSketch / KLL / HLL / CountSketch / CountMinSketch DPs are registered with `AggKind::Sketch { kind, config, .. }`, the lookup always returns an empty map for them, the engine bubbles up "No precomputed outputs found", and `handle_query` returns `None` → HTTP responds `errorType: bad_data` / `error: "No result for query"`. Sketches DO reach `SketchStore` — they're readable via the sid-keyed `query_range(sid, ...)` path which filters on `payload.as_sketch()`. The agg-keyed precompute lookup is the gap. This PR adds doc-comment blocks at both the call site (`engine.rs::execute_store_query`) and the function definition (`mod.rs::query_precomputes_by_agg`) flagging the gap with file:line citations and pointing at the two viable fixes: * teach `query_precomputes_by_agg` to also collect sketch payloads (assemble `Box<dyn AggregateCore>` from `payload.as_sketch()`) — non-trivial; payload shapes diverge. * route the legacy `handle_query` path through the newer `ASAPQueryEngine::execute(&str)` trait dispatcher (around engine.rs:3430) which already handles sketches via `idx.sids_for_policy(fp)` + reducer dispatch. No behaviour change. 690 lib + 27 binary tests pass. Co-authored-by: Claude Opus 4.7 (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.
Summary
Investigation following #249 (L5-walk fix) clarified two more ingest-path requirements that were silently dropping the OTLP DPs even after the streaming-config JSON shape was correct:
OTLP DP needs at least one attribute (or known sid). With both empty, the receiver hits the "invalid wire shape" drop in
route_modified_otlp_sketches_to_precompute(per the comment block atotel.rs:926—(sid=0, no attrs)is dropped). Test 3 now attachesservice="e2e-test"to the DP.The DP's
group_by_keysmust EXACTLY match the streaming-config policy'sgrouping_labelsforfind_policy_by_contentto bindpolicy_fpto the registered sid. The match is strict at ingest (asap_tier_analysis.rs:525) but subset at query time (asap_tier_analysis.rs:587) — intentional asymmetry (ingest needs uniqueness; queries can re-aggregate down). Test 3 now usesgroup_by_labels: ["service"]to align.After both alignments, the runtime-info endpoint shows the sketch state DID land in
SketchStore(earliest_timestamp_per_sidis populated). The query nevertheless still returnsbad_data/ "No result for query" — there's a remaining gap betweenSketchStore::instances_matchingand the engine's reducer dispatch. Untangling that needs deeper engine-path tracing (likely acandidate.required_capabilityvspolicy_capabilityasymmetry, or a sid-by-policy_fpreverse-index lookup failure).What this PR delivers
status == "success"is what remains for whoever closes the engine-path gap.Test plan
cargo test --test e2e_controller_plans_and_backend_serves: 3 passed🤖 Generated with Claude Code