Skip to content

feat(otel-app): whole-sketch F2 reporting mode (functional=f2) - #505

Merged
zzylol merged 2 commits into
mainfrom
feat/otel-app-f2-mode
Jun 17, 2026
Merged

zzylol merged 2 commits into
mainfrom
feat/otel-app-f2-mode

Conversation

@zzylol

@zzylol zzylol commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Stacked on #504 (base = fix/otel-app-cms-point-monitor-key). Adds the whole-sketch F2 reporting mode to the coordinated-sampling edge.

functional=f2: the edge reports its local whole-sketch L2 mass F2_i = Σ_x f(x)² as the monitor value, under identity (agg_id,"") (no per-point key). observe() keeps per-series window counts and maintains the running Σf² incrementally (an event on x with old count c adds 2c+1), so the coordinator sees F2 grow monotonically and drives the same slack countdown. Mode is auto-learned from the controller config's functional (or forced with -monitor-functional; empty infers cms_point when a key is set, else sum).

Pairs with ASAPQuery-backend#381 (F2 functional round-trip + the sampling unification). With the unification, the reported value (f_i / F2_i / sum) drives the monitor threshold, while per-edge sampling is the single whole-sketch ε-floor p=1/(1+ε²·rate).

Live-validated (8-node): edges auto-learn f2, hot-reload added=1, 0 unconfigured, stable differentiated grants.

🤖 Generated with Claude Code

zzylol and others added 2 commits June 17, 2026 09:36
Adds a third coordinated-sampling readout alongside cms_point/sum: functional=f2
reports the edge's local whole-sketch L2 mass F2_i = Σ_x f(x)² as the value,
under identity (agg_id, "") (no per-point key). observe() tracks per-series
window counts and maintains the running Σf² incrementally (an event on x with
old count c adds 2c+1), so the coordinator sees F2 grow monotonically within the
epoch and drives the same slack countdown. The coordinator allocation is
unchanged — p_i ∝ √(F2_i/rate_i) keeps the WHOLE sketch within ε, the right
signal when the queried point isn't known a priori (see ASAPQuery-backend#380
decision rule). Mode is learned from the controller config's functional, or
overridden with -monitor-functional; empty infers cms_point (key set) else sum.
Pairs with ASAPQuery-backend#feat-monitor-f2-live.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The flag was only consulted in the no-config fallback, so it couldn't force f2
when the controller config was learned but omitted/disagreed on functional (e.g.
an older control plane that publishes functional=""). Apply -monitor-functional
as an override on every monitor after learning; unset leaves the auto-learned
functional intact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
zzylol added a commit that referenced this pull request Jun 17, 2026
…obey it

Rewrites §Fig 9 to the unified result: per-edge sampling is the single whole-sketch
ε-floor p=1/(1+ε²·rate) for EVERY monitor type. Re-ran both on the unified
coordinator: cms_point collapses from the old √rate (0.0010/0.0022/0.0049) to the
ε-floor (0.0001/0.0003/0.0013); F2 unchanged (0.0102/0.0026/0.0007, was already at
the floor). All six points lie on one 1/(1+ε²·rate) curve (fig9_unified_sampling.png).
The √(f/rate) law was the exact-count artifact, retired in ASAPQuery-backend#381.
Requires #381 (backend unify) + #505 (F2 edge).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@zzylol
zzylol changed the base branch from fix/otel-app-cms-point-monitor-key to main June 17, 2026 21:42
@zzylol
zzylol merged commit 3b13ddc into main Jun 17, 2026
@zzylol
zzylol deleted the feat/otel-app-f2-mode 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