feat(otel-app): coordinator-driven (CDM) warm-metric sampling at the producer - #486
Merged
Merged
Conversation
- Apply -warm-sample-p to the trace-replay warm gauge (was synthetic-only), with -trace-metric-name to land the replayed series under a DDSketch- aggregated name (e.g. google_cluster_2019_cpu_rate) for the accuracy sweep. - Add CDM edge wiring (sample_controller.go): -coordinator-url / -monitor-agg-id / -edge-id make the producer report its per-window warm-metric rate to the data-plane monitor coordinator and apply the granted SampleP as the live warm-sample-p at the next window boundary (never mid-window), via the nested asap-precompute-go/monitor + monitor/grpcclient modules. - REPLAY_STATS log line (candidate/admitted) for ingest-load accounting. Verified: otel-app builds clean; two skewed edges → coordinator grants the hot edge p≈0.0065 (then 0.0113) while the quiet edge keeps p=1.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the producer (
otel-app, the "SDK") sample its warm sketch metric at a probabilityp— statically or driven by the CDM coordinator's grant — so dropped points never traverse the network or hit the collector. Demonstrated on the real 2019 Google cluster trace.Changes (all in
otel-app/)-warm-sample-p float(default 1.0): geometric drop of the warm metric's datapoints before SDK aggregation; now applies on the replay (-trace-file) path too (was synthetic-only).+ -trace-metric-name,-agg dd-fullprojection for the eval.sample_controller.go:otel-appis now a CDM edge — importsasap-precompute-go/monitor+monitor/grpcclient, reports its per-window warm-metric rate, and appliesgrant.SamplePas the live warm-sample-pat the next window boundary (never mid-window).COORDINATED_SAMPLING.md: the design + how to run it.Evidence (real 2019 Google cluster trace, 50k rows)
Accuracy — DDSketch quantile vs true quantile, sweeping
p:Rel-err stays ≈ DDSketch α (~1–2%) as
psweeps 10×, ingest drops ∝p(rank-preserving quantiles → no1/prescale).Coordinated
p— two skewed edges vsdata_plane --enable-monitor-coordinator: hot edge (~50k/win) applied grantedp=0.0065, quiet edge (~500/win) keptp=1.0— differentiated by the ε-coupling floor1/(1+ε²·rate).Builds clean (
go build,go vet). The coordinator/edge plumbing is the merged CDM coupling (#368/#481); this wires the producer end.🤖 Generated with Claude Code