Skip to content

MVP demo: agent emits full-attr sketches → no sid match for grouped streaming-config #271

Description

@zzylol

Found during the single-node MVP smoke test (/mydata/mvp-smoke-test/REPORT.md on the dev box). Sister to ASAPCollector#381 (agent OpAMP-push doesn't reload) — this is what makes Axis C (end-to-end PromQL) return empty even though Axis D shows 8800 sids registered.

Correction to an earlier version of this issue: the original write-up framed this as an "agg_id hash mismatch" between two xxh64 schemes. That's wrong — compute_sketch_sid was retired in PR #190/#192 and sid is now a counter (per docs/design-sid-lifecycle.md). The actual root cause is sid identity mismatch: the agent emits sketches with all wire attrs, so the backend mints sids over the full attr set, but the streaming-config (and the still-extant aggregation_id query path) expects sids grouped down to grouping_labels only.

What's stored

SeriesIdResolver mints sid = fetch_add(1) keyed by (metric_name, attrs_fingerprint, agg_kind_canonical). The fake-exporter emits http_requests_total_latency_ms with {zone, rack, node, pod, endpoint, service.name, telemetry.sdk.name, telemetry.sdk.language, telemetry.sdk.version} (9 keys); the agent's DDSketch processor doesn't drop or roll up any of them. So the backend mints 51 sids for http_requests_total_latency_ms — one per unique full-attr tuple — each carrying group_by_keys = [endpoint, node, pod, rack, service.name, telemetry.sdk.*, zone].

What the query path looks for

asap_query_engine/engine.rs:1743 logs:

Query execution failed: No precomputed outputs found for metric: http_requests_total_latency_ms,
                        aggregation_id: 16882953407686652000

16882953407686652000 is PolicyFingerprint::as_u64() of the streaming-config entry — xxh64(metric + agg_type + sub_type + params + grouping_labels=[zone] + aggregated_labels=[]). The store has no rows keyed by that agg_id because nothing on the ingest path computed a PolicyFingerprint with grouping_labels=[zone] (the agent never group-reduced before sketching).

Reproduction

bash /mydata/mvp-smoke-test/run_smoke.sh

After 90 s:

  • curl http://localhost:19091/api/v1/streaming-configaggregation_id: 16882953407686652000 registered
  • curl http://localhost:19091/api/v1/db/schemas → 51 sids for the metric, each with full-attr group_by_keys
  • curl 'http://localhost:19091/api/v1/db/timeline?metric=http_requests_total_latency_ms&start_ms=...&end_ms=...' → 1 segment under agg_id: 6206425945726099596 — note this is the timeline endpoint's content-derived signature id (xxh64 of metric + agg_kind + group_by_keys per the comment in handle_get_timeline), not the PolicyFingerprint the query path looks up. Two different hash schemes, both surfaced as agg_id in the API output — confusing but real.
  • curl --data-urlencode 'query=quantile_over_time(0.99, http_requests_total_latency_ms[30s])' http://localhost:19091/api/v1/query{"error":"No result for query"}

Fix paths

This sits at the intersection of two in-progress migrations:

  1. Schema-retirement feat: vendor DataCollector's modified OTLP proto (PR A, Phase 1) #5 in engine.rs:2392 — finish removing the aggregation_id lookup from the query plan and route queries directly through the sid catalog ((metric, agg_kind, attrs_subset) → sids that subsume the asked grouping). When this lands the agg_id path goes away entirely, and the question becomes "find sids whose group_by_keys are a superset of the query's grouping, then merge by the asked subset."
  2. Agent-side group-reduction — when ASAPCollector#381 lands and the controller's typed-stage-split YAML actually reaches the agent, the per-metric pipeline needs an attributes/keep (or equivalent) processor upstream of each sketch processor that whitelists grouping_labels. Then the agent emits sketches with attrs already reduced to [zone], the resolver mints the desired N-zone sids, and any query that asks for the streaming-config's grouping finds them directly.

Either fix unblocks Axis C. Both might land independently — (1) is purely backend, (2) needs ASAPCollector#381 first.

Tagged bug, mvp-demo, query-engine, schema-retirement-5.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions