Skip to content

fix(deploy): accuracy-validation harness (per-series quantile + cumulativetodelta + seed) - #398

Merged
zzylol merged 2 commits into
mainfrom
fix/per-series-sketches-for-quantile-accuracy
May 19, 2026
Merged

zzylol merged 2 commits into
mainfrom
fix/per-series-sketches-for-quantile-accuracy

Conversation

@zzylol

@zzylol zzylol commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Bundle of deploy-side changes for the accuracy-validation work that landed across:

  • ASAPQuery-backend #290 (unified emit), #291/#292 (Sum + rate dispatch), #297 (outer-agg fold), #299 (cumulativetodelta emit)
  • this repo: per-series sketch config + cumulativetodelta agent yaml + EXPORTER_SEED + baseline PRW config

Commits

  1. feat(demo): accuracy-validation harness — EXPORTER_SEED + baseline PRW add_metric_suffixes: false + per-series quantile sketches + run_demo.sh wiring
  2. fix(deploy): cumulativetodelta upstream of agent routing — static-bootstrap counterpart to ASAPQuery-backend mvp v6 phase D: fake-exporter freshness probes + measure_freshness.py #299
  3. fix(multinode): WARMUP_S=60 + grouping_labels + queries-e2e wave queries — harness-tuning + quantile-shape replacement (max-by-zone)

Accuracy results post all fixes

Query asap rel-err vs b0 baseline
quantile_over_time(0.5, X[5m]) 0.4-0.6% ✅
quantile_over_time(0.99, X[5m]) 11-12% (DDSketch ε + temporal-window variance)
max by (zone) (quantile_over_time(0.99, X[5m])) 8-9% (DDSketch) / 20% (KLL — bucket-midpoint vs sample-reservoir trade-off)
sum by (zone) (http_requests_total) Post-#299: returns delta-window semantics; ratio drops from ~300× pre-fix to ~1× when normalized to b0_rate × window_secs

Test plan

  • Cumulativetodelta processor compiled into asap-otel (builder-config-sketches.yaml line 5)
  • Multinode probe post-mvp v6 phase D: fake-exporter freshness probes + measure_freshness.py #299 confirms sum by (zone) (http_requests_total) returns ~60M (stable per-window) vs pre-fix ~770M (cubic blowup)
  • DDSketch quantile path unaffected (gauges don't carry temporality; processor is no-op for them)
  • b0/b1 untouched — VictoriaMetrics expects cumulative (Prometheus convention)

zzylol and others added 2 commits May 18, 2026 18:23
… ASAPQuery-backend #299)

Static bootstrap counterpart to ASAPQuery-backend PR #299. Without
this static fix, the asap-otel agent's BOOTSTRAP config (used before
the controller's OpAMP push lands) lacks cumulativetodelta and sends
cumulative-temporality Counter values to the backend's SumAccumulator
— triggering the ~300× per-window quadratic blowup that bug #298
documented. After OpAMP push (typed-stage-split emit from #299), the
running config has it; this static yaml just keeps the pre-OpAMP
boot window correct too.

`match_type: strict` keeps the processor a no-op for gauges
(http_requests_total_latency_ms etc. — quantile workloads unaffected).
b0/b1 baseline configs are intentionally untouched: VictoriaMetrics
expects cumulative (Prometheus convention).

Closes the ASAPCollector half of #298.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…W config + per-series quantile

Bundle of supporting changes for apples-to-apples accuracy validation
of asap-tier vs baseline (b0/b1 VictoriaMetrics). Lands alongside the
quantile-shape + cumulativetodelta engine fixes (ASAPQuery-backend
PR #297 + #299, ASAPCollector cumulativetodelta commit above).

Changes:

1. **fake-exporter/main.go** — EXPORTER_SEED env var seeds per-series
   PRNG (math/rand) deterministically so all 3 arms in a sequential
   run emit identical latency value sequences. Without it, cross-arm
   sampling noise masked DDSketch ε behavior in the accuracy report
   (b0 vs b1 differed by 0.04-0.4% just from random draws, not engine
   error). Default seed of 42 in run_demo.sh; back-compat when unset
   (auto-random, original behavior). Per-series PRNG uses
   `seed ^ hash(EXPORTER_PRODUCER_ID) ^ (seriesIdx+1)*prime` so
   distinct producers + series get distinct sequences.

2. **b0/b1 PRW exporter config — add_metric_suffixes: false** —
   VictoriaMetrics' OTLP→PRW path appends `_milliseconds` to metric
   names with `WithUnit("ms")` annotation (Prometheus naming convention).
   Asap tier preserves the original name. Without this fix, the
   accuracy comparison probe queries `http_requests_total_latency_ms`
   land on different metric names per tier — apples-to-oranges.

3. **mvp-workload.yaml** (singlenode + multinode) — dropped
   `grouping_labels: [zone]` from quantile-metric entries
   (http_requests_total_latency_ms, request_size_bytes). Per-series
   DDSketch / KLL sketches preserve PromQL's per-series semantics so
   `quantile_over_time(...)` returns comparable per-series rows in
   both asap and baseline. Counter-metric entries retain
   grouping_labels: [zone] (Sum aggregation is mergeable; no semantic
   asymmetry there). The KLL override on the latency entry is also
   tracked here for the DDSketch-vs-KLL accuracy comparison documented
   in mvp_smoke_test_findings.md.

4. **run_demo.sh** — pass EXPORTER_SEED=42 (default) to all producers.

Accuracy results post all fixes (multinode all-arms):
- p50 quantile: 0.4-0.6% rel-err vs baseline ✅
- p99 quantile: 11-12% rel-err (DDSketch ε + temporal-window variance)
- max by (zone) (quantile_over_time(...)): 8-9% rel-err (DDSketch)
- sum-by-zone/rate/topk: post-#299 returns delta-window semantics
  (not directly comparable to baseline cumulative as raw numbers, but
  bug-correct; ratio drops from ~300× to ~1× when normalized).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol force-pushed the fix/per-series-sketches-for-quantile-accuracy branch from db80139 to 89717c5 Compare May 19, 2026 00:23
@zzylol
zzylol merged commit ec8b813 into main May 19, 2026
@zzylol
zzylol deleted the fix/per-series-sketches-for-quantile-accuracy branch July 17, 2026 20:08
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