Skip to content

eval: fill nan columns in sweep CSV (paper blocker #3) - #258

Merged
zzylol merged 2 commits into
mainfrom
eval/fill-nan-columns-in-sweep-csv
May 5, 2026
Merged

zzylol merged 2 commits into
mainfrom
eval/fill-nan-columns-in-sweep-csv

Conversation

@zzylol

@zzylol zzylol commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fills the three nan columns in deploy/scripts/measure-baseline.py output that have been blocking paper claim KLL in telegraf aggreagtor #1 (bandwidth) and KLL in otel-client #5 (query latency) since Phase 2.11B: agent_in/out_kib_per_s on raw/Gorilla/Serf baselines, gateway_* + backend_samples_per_s for drop_original=true baselines, and backend_query_p99_ms whenever the soak doesn't drive queries.
  • Three fixes layered into the existing measurement script (no new infrastructure, no rebuild of asap/sketchcol:dev):
    1. docker-stats agent net rx/tx fallback for agent_in/out_kib_per_s (captures on-the-wire bytes, which is what claim KLL in telegraf aggreagtor #1 actually wants — the patched processor counter measures in-process protobuf bytes; see the new docs/eval-instrumentation-notes.md for the caveat).
    2. or vector(0) on gateway PromQL + the gateway-egress fallback so B1/B5 (drop_original: true → no traffic) report 0 instead of NaN, while keeping NaN reserved for "Prometheus is gone".
    3. --replay-jsonl PATH flag computes backend_query_p99_ms client-side from promql_replay.py's JSONL output. Wired through run_e2e_sweep.sh (always-on) and run-baseline-sweep.sh (DRIVE_QUERIES=1 opt-in). Survives the docker compose down -v between cells, where the Prom histogram doesn't.

Verification

deploy/eval-results/sweep-smoke-postfix-20260505.csv is one fresh cell per baseline family (b0a, b0b, b1, b3-delta, b4, b5) at N=1, rate=1000, cardinality=1000. Zero NaN cells across the 17 columns × 6 baselines.

Coverage table per baseline (post-fix):

Baseline agent_*_kib_per_s gateway_* backend_samples_per_s backend_query_p99_ms
b0a-raw-stream docker-stats direct gateway-egress fallback client-side from replay JSONL
b0b-raw-batched docker-stats direct gateway-egress fallback client-side from replay JSONL
b1-serf docker-stats 0 (drop_original) 0 (drop_original) client-side from replay JSONL
b3-delta direct (sketch) direct direct or fallback direct or client-side
b4-tunable direct (sketch) direct direct or fallback direct or client-side
b5-gorilla docker-stats 0 (drop_original) 0 (drop_original) client-side from replay JSONL

Test plan

  • All six baseline families produce 17 non-NaN columns in a single sweep cell. CSV checked into deploy/eval-results/sweep-smoke-postfix-20260505.csv.
  • python3 -m py_compile deploy/scripts/measure-baseline.py clean; bash -n run-baseline-sweep.sh and bash -n run_e2e_sweep.sh clean.
  • No regression in existing CSVs — the docker-stats fallback only fires when the patched-processor counter is NaN (sketch baselines unchanged), and the or vector(0) only applies when the underlying counter is missing.
  • No asap-precompute-rs/src/otap/ or asap-precompute-rs/Cargo.toml touched (parallel agent's OTAP-codec work).

Open questions / surprises

  • The patched-processor *_bytes_total family measures in-process protobuf bytes (via pmetric.ProtoMarshaler.MetricsSize) — not bytes-on-the-wire. They differ for raw paths because the wire bytes include gRPC framing + HTTP/2 headers that the in-process counter doesn't. Sketch payloads happen to overlap closely (~5%) because the typed proto envelope IS the wire payload. The doc spells out which one to use for which paper figure.
  • asap_ingest_samples_total is NOT exposed by the current asap/query-backend:dev image — only query-side counters are. The fallback uses otelcol_exporter_sent_metric_points_total{job="gateway"} (gateway egress = backend ingest, modulo dropped batches). Proper fix is a backend-side counter; tracked as follow-up in ASAPQuery-backend.
  • b5-gorilla and b1-serf show producer_cpu_cores ≈ 2 even with EXPORTER_SDK_AGG=default — much higher than b3-delta's 0.27. The producer measure is the same SDK so it shouldn't depend on the baseline; might be a docker-stats sample-window artifact at 5s on a busy host. Out of scope for this PR; flagged in the doc.

What's deliberately NOT fixed

  • Backend-side asap_ingest_samples_total counter. Fallback works; proper fix is in the ASAPQuery-backend repo and a separate paper-blocker.
  • Grafana dashboards for the five evaluation axes (mentioned alongside the NaN gap in PROGRESS.md blocker DDSketch in opentelemetry-client #3). Separate work; the column-population fixes here are the prerequisite.
  • Producer CPU anomaly on raw baselines (~2 cores even at default agg) — measurement is correct, the value just looks high; flagged in the doc rather than tuned.

🤖 Generated with Claude Code

zzylol and others added 2 commits May 5, 2026 14:53
Three fixes in deploy/scripts/measure-baseline.py so every column
in the multi-agent sweep CSV is populated for every baseline
family. Previously raw / Gorilla / Serf baselines (b0a, b0b, b1,
b5) left agent_in/out_kib_per_s NaN because the patched-processor
self-monitor counter was the only source, and backend_query_p99_ms
was NaN whenever the soak didn't drive queries.

Fixes:

1. agent_in/out_kib_per_s: docker-stats agent net rx/tx fallback
   when otelcol_datacollector_processor_*_bytes_total is absent.
   Captures on-the-wire bytes, which is what bandwidth claim #1
   actually wants. The two paths measure different things — see
   the new docs/eval-instrumentation-notes.md for the
   in-process-vs-wire-bytes caveat and which side the paper figure
   should use.

2. gateway_*/backend_samples_per_s: added `or vector(0)` to the
   PromQL so B1/B5 baselines (drop_original=true → no traffic)
   report 0 instead of NaN. Distinguishes "Prometheus is gone"
   (still NaN) from "this baseline structurally bypasses the
   gateway" (now 0).

3. backend_query_p99_ms: new --replay-jsonl PATH flag computes
   p99 of successful duration_ms from the promql_replay client's
   JSONL output. Survives docker compose down -v between cells in
   run_e2e_sweep.sh. Wired through both
   run_e2e_sweep.sh (always-on) and run-baseline-sweep.sh
   (DRIVE_QUERIES=1 opt-in).

Verification: deploy/eval-results/sweep-smoke-postfix-20260505.csv
covers one cell per baseline family (b0a, b0b, b1, b3-delta, b4,
b5) with no NaN in any of the 17 columns. Generated against the
e2e-overlay stack with EXPORTER_SDK_AGG=default and freq 100Hz.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit 86a7c30 into main May 5, 2026
@zzylol
zzylol deleted the eval/fill-nan-columns-in-sweep-csv branch May 9, 2026 18:00
zzylol added a commit that referenced this pull request May 16, 2026
#379)

Two-part sync with asapquery-backend.

1. **Migrate CMS / CountSketch streaming-configs to canonical
   `w` / `d`** — sibling of asapquery-backend PR #268. The backend's
   `cms_params` helpers now read `w` (=cols) / `d` (=rows) first
   with `row_num` / `col_num` as legacy fallback, matching what the
   controller's `sketch_params_to_json` emits and what the OTLP
   policy_fp content match (`derive_sketch_policy_fp`) uses. The
   static asapcollector YAMLs were stuck on the older
   `row_num` / `col_num` form, which broke OTLP policy_fp lookup
   for sids ingested against these configs. Migrating to `w` / `d`
   aligns the static configs with the runtime expectation.

2. **Retire `SetAggregator` references** in inference-config doc
   comments. The exact-set-membership family
   (`SetAggregator` / `DeltaSetAggregator`) was retired wholesale
   in asapquery-backend PR #264. Comments here pointed at the
   retired family as a "tracked upstream" limitation for per-key
   top-K enumeration; updated to point at the actual solution
   (heap-bearing `CountSketchWithHeap` / `CountMinSketchWithHeap`
   from PR #258).

No behavior change for the runtime — the backend's compat path
(PR #268) keeps the legacy keys working, and the SetAggregator
retirement (PR #264) doesn't affect any of the policies in these
files. This is the static-config side of the cross-repo sync.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zzylol added a commit that referenced this pull request May 17, 2026
…380)

* deploy(configs): canonical w/d param keys + retire SetAggregator notes

Two-part sync with asapquery-backend.

1. **Migrate CMS / CountSketch streaming-configs to canonical
   `w` / `d`** — sibling of asapquery-backend PR #268. The backend's
   `cms_params` helpers now read `w` (=cols) / `d` (=rows) first
   with `row_num` / `col_num` as legacy fallback, matching what the
   controller's `sketch_params_to_json` emits and what the OTLP
   policy_fp content match (`derive_sketch_policy_fp`) uses. The
   static asapcollector YAMLs were stuck on the older
   `row_num` / `col_num` form, which broke OTLP policy_fp lookup
   for sids ingested against these configs. Migrating to `w` / `d`
   aligns the static configs with the runtime expectation.

2. **Retire `SetAggregator` references** in inference-config doc
   comments. The exact-set-membership family
   (`SetAggregator` / `DeltaSetAggregator`) was retired wholesale
   in asapquery-backend PR #264. Comments here pointed at the
   retired family as a "tracked upstream" limitation for per-key
   top-K enumeration; updated to point at the actual solution
   (heap-bearing `CountSketchWithHeap` / `CountMinSketchWithHeap`
   from PR #258).

No behavior change for the runtime — the backend's compat path
(PR #268) keeps the legacy keys working, and the SetAggregator
retirement (PR #264) doesn't affect any of the policies in these
files. This is the static-config side of the cross-repo sync.

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

* fix(deploy): MVP smoke-test blockers — image build + agent OpAMP URL

Three deploy-side bugs found while bringing up the single-node MVP
demo (controller → backend → gateway → 1 agent → 1 fake-exporter):

1. Dockerfile.backend: rename build targets to the post-reorg
   binary names (`query_engine_rust` → `data_plane`,
   `controller` → `control_plane`). The May 2026 data-plane reorg
   renamed the workspace's `[[bin]]` packages; the Dockerfile still
   asked cargo for the old names and `docker build` failed at the
   `cargo build` step. Runtime install paths
   (`/usr/local/bin/asap-query-backend`, `/usr/local/bin/controller`)
   are preserved so existing compose stacks work unmodified.

2. All static agent configs hardcoded `ws://backend:4320/v1/opamp`
   for the OpAMP server. Post Phase-9 single-binary refactor the
   controller and backend share the `asap/query-backend:dev` image
   but bind separate listeners under separate compose service names;
   the OpAMP server is on `controller`, not `backend`. With the old
   URL the agent never connects, so `/api/v1/agents` is empty and
   the controller can't push runtime config. Sweep across all 17
   affected `asap-otel-agent-*.yaml` (singlenode + multinode).

3. opentelemetry-go-patch's exporter/transform/metricdata.go and
   series/dictionary.go reference proto fields that the 2026-05
   sketch proto refactor removed (`Count`, `Sum`, `Min`, `Max` on
   DDSketch/KLL/HLL DPs; `Dimension`/`Epsilon`/`Delta` on
   CountSketch DP; `SampleCount`/`Rows`/`Cols` on CountMinSketch
   DP; `seriesEntry.seriesID` renamed to `.id`). Without this fix
   `docker build -f Dockerfile.fake-exporter` fails at `go build`
   with a wall of `undefined: mpb.DDSketchDataPoint_SumAsInt` etc.

A walkthrough of the smoke test (4 axes: controller→agent OpAMP,
controller→backend streaming-config, end-to-end PromQL, sketch
wire-format roundtrip) is at /mydata/mvp-smoke-test/REPORT.md.

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