Skip to content

feat: CMS/CS bandwidth optimisations — full-sketch Opt-1/2/3, delta packed-array encoding, adaptive transmission - #91

Merged
zzylol merged 5 commits into
mainfrom
bench/delta-vs-raw-baseline
Mar 30, 2026
Merged

zzylol merged 5 commits into
mainfrom
bench/delta-vs-raw-baseline

Conversation

@zzylol

@zzylol zzylol commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Problem

CMS and CS full-sketch payloads were larger than raw samples before this PR. Even delta transmission made it worse — delta cells used fixed 64-bit floats, so a sparse delta could cost more than a full sketch:

Sketch Raw B/win Full B/win Delta B/win Raw/Full Raw/Delta
CMS (5×2048) 40 000 246 003 150 014 0.16× 0.27×
CS (ε=0.01) 40 000 655 554 87 507 0.06× 0.46×
HLL (16k regs) 40 000 16 532 8 543 2.42× 4.68×
DD (α=0.01) 40 000 882 45×
KLL (k=256) 40 000 3 074 3 074 13× 13×

Workload: deltaaccbench — 20 windows × 5 000 inserts, Zipf s=1.10, threshold=1.0. Raw baseline = 5 000 × 8 B uint64 hashes = 40 000 B/window.

Root causes and full analysis: docs/cms-cs-delta-transmission-optimizations.md


What was implemented

Six independent optimisations, applied in three layers:

Layer 1 — Full-sketch payload (sketchlib-go#45, DataCollector)

Opt Change Where
Opt-1 SerializePortableFO() — omit sum_counts/sum2_counts from CMS full payload; receiver reconstructs Sum = Sum2 = Count for unweighted streams (3× fewer arrays) sketchlib-go CountMinSketch/portable.go
Opt-2 counts_int sint64 (packed zigzag varint) replaces counts_float double for both CMS and CS; Zipf cells average 1–2 B instead of 8 B sketchlib-go CountMinSketch/portable.go, CountSketch/portable.go
Opt-3 CS epsilon: 0.01 → 0.02 — halves the error bound relative to raw while reducing the matrix 4× (16 384 → 4 096 columns) 9 YAML configs in cmd/countsketchcol/

Layer 2 — Delta-cell encoding (sketchlib-go@019e21e, DataCollector)

Opt Change Where
Opt-5 Replace repeated CountMinCell / repeated CountSketchCell proto messages with three parallel packed arrays (cell_rows uint32, cell_cols uint32, d_counts sint64); drops d_sum/d_sum2 from CMS delta cells (same reconstruction as Opt-1). Per-cell cost: 35 B → 4 B for CMS, 17 B → 4 B for CS. Backward-compat: old cells_legacy field retained for reading old producers. sketchlib-go proto/countminsketch/, proto/countsketch/, */delta_codec.go, */delta.go

Layer 3 — Adaptive transmission (DataCollector)

Fix Change Where
Opt-6 Both CMS and CS processors compute both full and delta payloads, then transmit whichever is smaller. Eliminates any scenario where delta costs more than full, regardless of workload fill rate. processor/countminsketchprocessor/processor.go, processor/countsketchprocessor/processor.go

Other changes

Change Where
Opt-4 CS TopK: SpaceSaving tracker replaces TopKHeap.UpdateCS; delta sends hh_keys (key strings only, no stale counts); downstream queries merged matrix for accurate globally-merged estimates. O(k) per insert → O(log k).
Fix cloneCMS Used DeserializeCountMinSketchFromBytes (gob) on proto bytes → nil clone → nil-pointer panic on 2nd window
Fix HLL API InsertValueInsert, EstimateCardinalityEstimate (sketchlib-go API rename)
Dep bump sketchlib-go pseudoversion → 019e21e25cce + local replace directives in all 22 go.mod files

Results

deltaaccbench — before vs after (20 windows × 5 000 inserts, Zipf s=1.10, threshold=1.0)

Sketch Payload Before After Reduction Opt
CMS full 246 003 B 10 950 B 22.5× Opt-1+2: drop sum/sum2, sint64 varint
CMS delta 150 014 B 17 755 B 8.5× Opt-5: packed arrays, drop d_sum/d_sum2
CMS wire (adaptive) 150 014 B 10 950 B 13.7× Opt-6: full is smaller at 91% fill rate
CS full 655 554 B 82 526 B 7.9× Opt-2+3: sint64 varint + 4× fewer cols
CS delta 87 507 B 22 500 B 3.9× Opt-5: packed arrays
CS wire (adaptive) 87 507 B 22 500 B 3.9× Opt-6: delta wins over full

CMS fill rate note: At 5 000 inserts/window into 5×2048 the fill rate is ~91% — nearly every cell changes. Even at 4 B/cell (packed), 4 500 cells × 4 B ≈ 18 KB exceeds the 11 KB FO full. Opt-6 (adaptive) ensures the smaller option is always sent. In the production deployment (500 series × 100 inserts/window, ~22% fill rate), the CMS delta is sparse and beats full.

All sketches after optimisation:

Accuracy measured by deltaaccbench: mean and max relative query error vs ground truth over 20 windows. Accuracy is a property of the sketch algorithm and dimensions, not of the transmission encoding.

Sketch Mode Delta Raw B/win Full B/win Delta B/win Raw/Full Raw/Delta Mean Rel Err Max Rel Err
CMS (5×2048) batch off 40 000 10 521 3.80× 0.16% 18.75%
CMS (5×2048) batch on (adaptive) 40 000 10 521 20 106 3.80× 1.99× 0.16% 18.75%
CMS (5×2048) window on (adaptive) 40 000 10 950 17 755 3.65× 2.25× 4.70% 150.00%
CS (ε=0.02) batch on 40 000 82 161 30 001 0.49× 1.33× 0.006% 7.14%
CS (ε=0.02) window on 40 000 82 526 22 500 0.48× 1.78× 0.091% 40.00%
HLL (16k regs) window on 40 000 16 532 8 543 2.42× 4.68× 0.73% 1.34%
DD (α=0.01) window off 40 000 882 45× 0.29% 0.82%
KLL (k=256) batch off 40 000 2 959 13.5× 0.26% 1.21%

CMS window mode shows high max relative error (150%) because the cumulative sketch is queried across 20 windows — most keys in later windows are rare and their absolute count is small, so even a 1-count estimation error produces a large relative error. The mean (4.70%) is dominated by the heavy hitters where CMS is accurate.

CPU & memory overhead — delta=on vs delta=off (deltaaccbench)

Sketch Mode Wall overhead CPU user overhead Heap delta
CMS batch +125% +137% +25%
CMS window +53% +31% +20%
CS batch +39% +29% −27%
CS window +37% +37% −15%
HLL window +72% +85% −5%

Real-OTel deployment — bench_4modes.sh (500 series × 10 sps, 60 s run)

OTel SDK → Agent Collector (:4317) → Backend nopcol (:4319). SDK→Agent bandwidth is identical across all modes (~270–287 KB/s) — the optimisation is entirely in the agent→backend hop.

Note: OTel SDK Float64Gauge uses LastValue aggregation — only the most recent value per series is exported each interval. "raw-batched(10s)" forwards ten 1-second exports at once; it does not recover intra-interval samples, hence only ~10% savings.

Bandwidth

Sketch Mode Agent→Backend KB/s Reduction vs raw
CMS raw-unbatched(1s) 23.1 baseline
CMS raw-batched(10s) 21.0 1.1×
CMS cms-full 2.6
CMS cms-delta 1.5 16×
CS raw-unbatched(1s) 23.1 baseline
CS raw-batched(10s) 21.0 1.1×
CS cs-full 0.86 27×
CS cs-delta 0.86 27×

CPU & memory

Sketch Mode Agent CPU avg Agent Mem avg MB Backend Mem avg MB
CMS raw-unbatched(1s) 3.5% 191 33
CMS raw-batched(10s) 3.2% 195 43
CMS cms-full 7.4% 418 67
CMS cms-delta 11.3% 752 ⚠️ 44
CS raw-unbatched(1s) 2.9% 43 35
CS raw-batched(10s) 2.5% 50 42
CS cs-full 2.6% 37 30
CS cs-delta 2.6% 37 30

Key takeaways:

  • CS (full or delta) achieves 27× bandwidth reduction at only 37 MB agent memory — best overall
  • CMS delta achieves 16× reduction but costs 752 MB agent memory for 500 series (per-series snapshot storage for 10 s windows)
  • CS memory efficiency is largely due to Opt-3 (ε=0.02 reduces matrix 4×)
  • Raw batching saves ~10% — confirms sketch-based aggregation is the only meaningful approach

CS TopK: Space Saving vs prior heap

Property Before (heap UpdateCS) After (Weighted Space Saving)
Existing key update Always +1 — ignores weight += w — correct for any weight
New key admission Only if CS estimate > min; otherwise silently dropped Always — evicts min, new entry starts at min + w
Find cost O(k) linear scan O(1) hash map
Total per insert O(k) O(log k)
Counts forwarded Stale upstream-local estimates None — downstream queries merged matrix
Formal guarantee None Any key with total weight > W/k is tracked

Test plan

  • go build ./cmd/deltaaccbench passes (sketchlib-go@019e21e)
  • go run ./cmd/deltaaccbench --windows=20 --inserts=5000 pre-opt baseline reproduced
  • go run ./cmd/deltaaccbench --windows=20 --inserts=5000 post-opt retest (2026-03-30)
  • sketchlib-go go test ./sketches/CountSketch/... ./sketches/CountMinSketch/... ./sketches/SpaceSaving/... pass
  • cmd/countminsketchcol/dist binary builds clean
  • cmd/countsketchcol/dist binary builds clean
  • bench_4modes.sh --sketch cms --duration 60s completes (4 modes × CMS)
  • bench_4modes.sh --sketch cs --duration 60s completes (4 modes × CS)

🤖 Generated with Claude Code

zzylol and others added 5 commits March 28, 2026 15:52
…ne results

The deltaaccbench tool called InsertValue/EstimateCardinality which don't
exist in the local sketchlib-go HLL implementation; fix to use Insert/Estimate.

Adds benchmark results doc (docs/benchmark-delta-vs-raw-baseline-2026-03-28.md)
with full CPU, memory, and bandwidth numbers from a 20-window × 5 000-insert run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds RawBytes (8 B × inserts/window, proto-packed fixed64) to every
windowResult and AvgRawBytes / RawVsFullRatio / RawVsDeltaRatio to
sketchResult, so the table and CSV now show all three tiers:

  Raw B avg | Full B avg | Delta B avg | Full/Delta | Raw/Full | Raw/Delta

Updates the benchmark results doc with the three-way comparison table
and per-sketch interpretation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Documents four optimisations that together bring CMS/CS delta payloads
below the raw-sample baseline (~10 KB vs 40 KB for CMS, ~2–4 KB for CS):

  Opt-1: omit sum_counts/sum2_counts (3× CMS reduction, unweighted streams)
  Opt-2: sint64 packed varint instead of float64 (4–8×, schema already exists)
  Opt-3: CS epsilon 0.01 → 0.02 config change (4× column reduction)
  Opt-4: replace TopK heap with Space Saving key candidates —
         covers weighted inserts, eliminates upstream CS query per insert,
         downstream TopK built from globally-merged counts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Applies the four CMS/CS delta-payload optimisations designed in
docs/cms-cs-delta-transmission-optimizations.md to the DataCollector
pipeline. Depends on sketchlib-go PR ProjectASAP/sketchlib-go#45
(feat/cms-cs-payload-opts, commit b24e56e).

## Opt-1 + Opt-2 — CMS FrequencyOnly + sint64 varint

opentelemetry-go-patch/sdk/metric/internal/aggregate/countminsketch.go:
  serializeCMSketch() → s.SerializeProtoBytesFO()
  (was: s.SerializeProtoBytes(); now: FrequencyOnly + sint64 encoding)

opentelemetry-collector-contrib-patch/processor/countminsketchprocessor/processor.go:
  serializeCMS() → s.SerializeProtoBytesFO()
  Removes now-unused proto.Marshal import.

Combined effect: CMS full/delta payloads drop from ~246 KB / ~150 KB
per window to ~6–10 KB per window (Opt-1 saves 3×, Opt-2 saves 4–8×).

## Opt-3 — CS epsilon 0.01 → 0.02

All 9 YAML configs in opentelemetry-collector-contrib-patch/cmd/countsketchcol/
updated: epsilon: 0.01 → 0.02. Also updates opentelemetry-app configs.
Effect: CS column count drops 16384 → 4096 (4× reduction), bringing
CS delta payloads from ~88 KB to ~22 KB per window.

## Dependency — sketchlib-go pseudoversion bump

All 22 go.mod files updated to sketchlib-go pseudoversion
v0.0.0-20260328221809-b24e56e64e94 (commit b24e56e on feat/cms-cs-payload-opts).
Local replace directives added to all go.mod files that were missing them
so builds resolve via local /mydata/sketchlib-go without requiring
module proxy access to the private GitHub repo.

Design reference: docs/cms-cs-delta-transmission-optimizations.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the full 4-mode (raw-unbatched / raw-batched / full-sketch / delta-sketch)
transmission benchmark infrastructure and fixes two bugs found during the run.

Benchmark infra (bench_4modes.sh):
- Orchestrates SDK → Agent(:4317) → Backend nopcol(:4319) pipeline
- Measures SDK→Agent and Agent→Backend bandwidth separately via /proc/net/dev
  and ss(8) bytes_sent
- Samples agent/backend CPU% and RSS every 1s; emits per-mode result.json
- Supports --sketch cms|cs|all, --duration, --series, --rate flags
- New agent configs: config-bench-{raw-unbatched,raw-batched,cms/cs-full,cms/cs-delta}.yaml
  for countminsketchcol, countsketchcol, and nopcol

Bug fixes:
- processor/countminsketchprocessor: cloneCMS called DeserializeCountMinSketchFromBytes
  (gob) on proto-serialized bytes → nil clone → nil-pointer panic on 2nd window.
  Fix: use DeserializeCountMinSketchFromProtoBytes.
- opentelemetry-go-patch/hllsketch.go: InsertValue/EstimateCardinality renamed to
  Insert/Estimate in current sketchlib-go HLL API.

Benchmark results (500 series × 10 sps, 60s, loopback):
  CMS raw-unbatched  SDK→Agent 287 KB/s  Agent→Backend  23 KB/s  AgentMem 191 MB
  CMS raw-batched    SDK→Agent 284 KB/s  Agent→Backend  21 KB/s  AgentMem 195 MB
  CMS full sketch    SDK→Agent 271 KB/s  Agent→Backend 2.6 KB/s  AgentMem 418 MB
  CMS delta sketch   SDK→Agent 270 KB/s  Agent→Backend 1.5 KB/s  AgentMem 752 MB
  CS  raw-unbatched  SDK→Agent 287 KB/s  Agent→Backend  23 KB/s  AgentMem  43 MB
  CS  raw-batched    SDK→Agent 284 KB/s  Agent→Backend  21 KB/s  AgentMem  50 MB
  CS  full sketch    SDK→Agent 269 KB/s  Agent→Backend 0.86 KB/s AgentMem  37 MB
  CS  delta sketch   SDK→Agent 269 KB/s  Agent→Backend 0.86 KB/s AgentMem  37 MB

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zzylol zzylol changed the title bench: delta transmission vs raw baseline — CPU, memory, bandwidth results bench/feat: delta transmission vs raw baseline + Opt-1/2/3 payload retest (deltaaccbench) Mar 30, 2026
@zzylol zzylol changed the title bench/feat: delta transmission vs raw baseline + Opt-1/2/3 payload retest (deltaaccbench) bench/feat: delta transmission vs raw + Stage 1/2 packed-array encoding + adaptive full/delta Mar 30, 2026
@zzylol zzylol changed the title bench/feat: delta transmission vs raw + Stage 1/2 packed-array encoding + adaptive full/delta feat: CMS/CS bandwidth optimisations — full-sketch Opt-1/2/3, delta packed-array encoding, adaptive transmission Mar 30, 2026
@zzylol
zzylol merged commit 0f13472 into main Mar 30, 2026
@zzylol
zzylol deleted the bench/delta-vs-raw-baseline branch March 30, 2026 19:54
SieDeta pushed a commit that referenced this pull request Apr 17, 2026
…acked-array encoding, adaptive transmission (#91)

* bench: fix deltaaccbench HLL API mismatch and add delta-vs-raw baseline results

The deltaaccbench tool called InsertValue/EstimateCardinality which don't
exist in the local sketchlib-go HLL implementation; fix to use Insert/Estimate.

Adds benchmark results doc (docs/benchmark-delta-vs-raw-baseline-2026-03-28.md)
with full CPU, memory, and bandwidth numbers from a 20-window × 5 000-insert run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* bench: add raw-sample column to deltaaccbench (Raw vs Full vs Delta)

Adds RawBytes (8 B × inserts/window, proto-packed fixed64) to every
windowResult and AvgRawBytes / RawVsFullRatio / RawVsDeltaRatio to
sketchResult, so the table and CSV now show all three tiers:

  Raw B avg | Full B avg | Delta B avg | Full/Delta | Raw/Full | Raw/Delta

Updates the benchmark results doc with the three-way comparison table
and per-sketch interpretation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: CMS/CS delta transmission optimisation design

Documents four optimisations that together bring CMS/CS delta payloads
below the raw-sample baseline (~10 KB vs 40 KB for CMS, ~2–4 KB for CS):

  Opt-1: omit sum_counts/sum2_counts (3× CMS reduction, unweighted streams)
  Opt-2: sint64 packed varint instead of float64 (4–8×, schema already exists)
  Opt-3: CS epsilon 0.01 → 0.02 config change (4× column reduction)
  Opt-4: replace TopK heap with Space Saving key candidates —
         covers weighted inserts, eliminates upstream CS query per insert,
         downstream TopK built from globally-merged counts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(cms-cs): implement Opt-1/2/3 payload optimisations in DataCollector

Applies the four CMS/CS delta-payload optimisations designed in
docs/cms-cs-delta-transmission-optimizations.md to the DataCollector
pipeline. Depends on sketchlib-go PR ProjectASAP/sketchlib-go#45
(feat/cms-cs-payload-opts, commit b24e56e).

## Opt-1 + Opt-2 — CMS FrequencyOnly + sint64 varint

opentelemetry-go-patch/sdk/metric/internal/aggregate/countminsketch.go:
  serializeCMSketch() → s.SerializeProtoBytesFO()
  (was: s.SerializeProtoBytes(); now: FrequencyOnly + sint64 encoding)

opentelemetry-collector-contrib-patch/processor/countminsketchprocessor/processor.go:
  serializeCMS() → s.SerializeProtoBytesFO()
  Removes now-unused proto.Marshal import.

Combined effect: CMS full/delta payloads drop from ~246 KB / ~150 KB
per window to ~6–10 KB per window (Opt-1 saves 3×, Opt-2 saves 4–8×).

## Opt-3 — CS epsilon 0.01 → 0.02

All 9 YAML configs in opentelemetry-collector-contrib-patch/cmd/countsketchcol/
updated: epsilon: 0.01 → 0.02. Also updates opentelemetry-app configs.
Effect: CS column count drops 16384 → 4096 (4× reduction), bringing
CS delta payloads from ~88 KB to ~22 KB per window.

## Dependency — sketchlib-go pseudoversion bump

All 22 go.mod files updated to sketchlib-go pseudoversion
v0.0.0-20260328221809-b24e56e64e94 (commit b24e56e on feat/cms-cs-payload-opts).
Local replace directives added to all go.mod files that were missing them
so builds resolve via local /mydata/sketchlib-go without requiring
module proxy access to the private GitHub repo.

Design reference: docs/cms-cs-delta-transmission-optimizations.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* bench: 4-mode real-OTel BW benchmark + fix CMS delta crash + fix HLL API

Adds the full 4-mode (raw-unbatched / raw-batched / full-sketch / delta-sketch)
transmission benchmark infrastructure and fixes two bugs found during the run.

Benchmark infra (bench_4modes.sh):
- Orchestrates SDK → Agent(:4317) → Backend nopcol(:4319) pipeline
- Measures SDK→Agent and Agent→Backend bandwidth separately via /proc/net/dev
  and ss(8) bytes_sent
- Samples agent/backend CPU% and RSS every 1s; emits per-mode result.json
- Supports --sketch cms|cs|all, --duration, --series, --rate flags
- New agent configs: config-bench-{raw-unbatched,raw-batched,cms/cs-full,cms/cs-delta}.yaml
  for countminsketchcol, countsketchcol, and nopcol

Bug fixes:
- processor/countminsketchprocessor: cloneCMS called DeserializeCountMinSketchFromBytes
  (gob) on proto-serialized bytes → nil clone → nil-pointer panic on 2nd window.
  Fix: use DeserializeCountMinSketchFromProtoBytes.
- opentelemetry-go-patch/hllsketch.go: InsertValue/EstimateCardinality renamed to
  Insert/Estimate in current sketchlib-go HLL API.

Benchmark results (500 series × 10 sps, 60s, loopback):
  CMS raw-unbatched  SDK→Agent 287 KB/s  Agent→Backend  23 KB/s  AgentMem 191 MB
  CMS raw-batched    SDK→Agent 284 KB/s  Agent→Backend  21 KB/s  AgentMem 195 MB
  CMS full sketch    SDK→Agent 271 KB/s  Agent→Backend 2.6 KB/s  AgentMem 418 MB
  CMS delta sketch   SDK→Agent 270 KB/s  Agent→Backend 1.5 KB/s  AgentMem 752 MB
  CS  raw-unbatched  SDK→Agent 287 KB/s  Agent→Backend  23 KB/s  AgentMem  43 MB
  CS  raw-batched    SDK→Agent 284 KB/s  Agent→Backend  21 KB/s  AgentMem  50 MB
  CS  full sketch    SDK→Agent 269 KB/s  Agent→Backend 0.86 KB/s AgentMem  37 MB
  CS  delta sketch   SDK→Agent 269 KB/s  Agent→Backend 0.86 KB/s AgentMem  37 MB

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
zzylol added a commit that referenced this pull request May 7, 2026
After backend PRs #91 / #92 / #93 land, this commit:

1. Migrates `deploy/configs/backend-storage-routing.yaml` to the v7
   dual-routing schema. http_requests_total fans out to TWO targets
   — warm-tier default + cold-archive `[count, topk, rate_post_hoc]`.
   Freshness probes route via gorilla.

2. Patches `asap-gorilla::IndexEntry` + `IndexFile` to accept BOTH
   the backend-canonical and agent-side JSON shapes (the agent's
   `gorillas3processor` writes `object`/`start_ts_nano`/`point_count`;
   backend writes `key`/`time_range`/`sample_count`). 3 new tests.

3. Patches `deploy/scripts/measure_freshness.py` to filter NaN
   responses from gorilla on empty windows. Pre-v7 the int
   conversion blew up the script entirely; now we keep polling.

4. Patches `deploy/docker-compose/base.yml` to make backend
   `RUST_LOG` env-overridable via `BACKEND_RUST_LOG`.

5. Patches `gorillas3processor.encoder.go` to write the seriesCount
   slot at byte offset 9 (post-magic, post-version) instead of the
   buggy offset 5. Pre-v7 every chunk landed with corrupted header
   bytes — invisible because no consumer decoded them; v7's
   `last_over_time` query path is the first that does.

6. Includes the v7 demo run artifacts under
   `deploy/eval-results/mvp-v7-2026-05-06/` plus an annotated
   `MVP_REPORT_v7.md` with v6.1 → v7 verdict diff and the diagnosis
   chain explaining why ④ and ⑥ remain UNKNOWN despite the routing
   side closing fully (agent encoder rebuild + SimpleEngine raw
   counter support are deferred next steps).

The agent encoder fix is staged as a code-level commit; it takes
effect only after rebuilding `asap/sketchcol:dev` from the patched
go binary, which requires the local OCB build chain. That rebuild
is out of v7's two-change scope.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zzylol added a commit that referenced this pull request May 7, 2026
The original 3-phase plan (always-archive at gateway / delete JSONL /
PromQL completeness) is partially superseded by what shipped via v5/v7.
Updated to reflect what's already on main and what genuinely remains:

- "Always-archive at gateway" effectively shipped via dual-routing
  (PR #91): BackendStorageRouting now allows multi-target per metric
- The archive-tier engine has gained postings filtering (PR #295),
  partial-S3 reads (PR #295), concat-only compactor (PR #295), and
  freshness-pattern registration (PR #91)

Two outstanding items remain:
- Delete the JSONL cold-fallback (now safely unreachable under normal
  routing)
- PromQL completeness on GorillaQueryEngine (Path A: vendor
  prometheus/promql via sidecar; Path B: pure-Rust evaluator; Path C:
  curated subset extension)

Adds a "what's already on main" diff table at the top so reviewers
immediately see what's done vs. what's outstanding. Adds a sentence
about Prometheus-block-compatible layout potentially letting Thanos
store-gateway answer queries directly (cross-references the
comparison doc).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zzylol added a commit that referenced this pull request May 7, 2026
… on GorillaQueryEngine (#292)

* docs: design for JSONL deprecation + always-archive Gorilla-S3 + PromQL completeness

Three-phase proposal to collapse ASAP's cold-fallback tier (JSONL) into
the Gorilla-S3 archive tier:

- Phase 1: always-archive every metric at the gateway (mirrors
  Databricks' Hydra always-streaming pattern); ~1-2 days
- Phase 2: delete the JSONL path (LocalFsColdStore, parse_jsonl, raw-tee
  exporter, StorageBackend::ColdJsonlFallback enum variant, paper §Cold-
  fallback tier prose, cost-model "cold-tier scan bytes" line item);
  ~1-2 days
- Phase 3: PromQL completeness on GorillaQueryEngine. Three sub-paths:
  Path A (vendor Prometheus' promql package, ~2 weeks, recommended for
  correctness), Path B (pure-Rust evaluator, ~4-6 weeks, correctness
  risk), Path C (extend curated subset, ~1 week, ships fast but
  reviewers may push back).

Recommends Phase 1+2 combined for paper deadline (drops cold-fallback
prose); Phase 3 ships as Path C bridge with Path A as post-deadline
follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: rewrite to reflect post-v7 state

The original 3-phase plan (always-archive at gateway / delete JSONL /
PromQL completeness) is partially superseded by what shipped via v5/v7.
Updated to reflect what's already on main and what genuinely remains:

- "Always-archive at gateway" effectively shipped via dual-routing
  (PR #91): BackendStorageRouting now allows multi-target per metric
- The archive-tier engine has gained postings filtering (PR #295),
  partial-S3 reads (PR #295), concat-only compactor (PR #295), and
  freshness-pattern registration (PR #91)

Two outstanding items remain:
- Delete the JSONL cold-fallback (now safely unreachable under normal
  routing)
- PromQL completeness on GorillaQueryEngine (Path A: vendor
  prometheus/promql via sidecar; Path B: pure-Rust evaluator; Path C:
  curated subset extension)

Adds a "what's already on main" diff table at the top so reviewers
immediately see what's done vs. what's outstanding. Adds a sentence
about Prometheus-block-compatible layout potentially letting Thanos
store-gateway answer queries directly (cross-references the
comparison doc).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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