Repository navigation
Conversation
asap-collector --config pipeline.yaml runs the upstream controller (startup, admin /metrics and /readyz, signal handling) with the asap_sketches processor and the scenario generator registered, so every pipeline stage can run as a real collector process in its own container.
Sketches with the same series and window are merged and emitted once, a grace period after the window ends; later arrivals are counted as late. The ASAPv1 decode used by the carrier check becomes a shared sketches::decode_snapshot.
Both emit asap.quantile, asap.distinct, asap.topk and asap.points gauges in one shape, labelled method=sketch or method=exact, so dashboards can overlay them. Sketch answers carry lower/upper bounds from each sketch's configuration (HLL 95% standard error, KLL normalized rank error, Count-Min overestimate). exact_answers groups raw points into event-time windows and is both the ground truth and the exact baseline.
A tumbling window used to close only on a timer started at the first message, so up to one window of later points landed in the previous window. Now a batch whose event time passes the open window's end closes it first, and the idle timer runs every second. aggregate_by selects the labels that identify a series (empty keeps every label).
deploy/telemetry-functions: generators, branches (sketch + raw copy via the official fanout), window merge, detector and the exact baseline each run asap-collector in their own container on their own CPU, over OTLP/HTTP. Prometheus receives sketch and exact answers over OTLP and scrapes every engine's own telemetry (CPU time, RSS, payload bytes per stage); Grafana overlays the sketch answer and its bound on the exact answer. Answers are written as plain OTLP gauges with labels on each point.
zzylol
force-pushed
the
feat/scenario-generator
branch
from
October 13, 2026 00:20
2059d27 to
dac5fa3
Compare
zzylol
force-pushed
the
feat/collector-containers
branch
from
October 13, 2026 00:20
80a9024 to
0f795de
Compare
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.
Part 3 of the RFC 0001 stack. This is the deployment the use cases run on.
Before → after
asap_sketchesprocessor only ran in-process or behind the file-passing demo. The container benchmark used a separate model processor.asap-collector: the upstream controller with the ASAP nodes linked in), in its own container pinned to its own CPU, talking OTLP/HTTP over the network. The sketch answers are shown next to exact answers computed from the same traffic.New pieces
asap-collector: the upstreamdf_enginestartup (admin/metrics,/readyz, signals) with the ASAP nodes registered.window_merge: merges sources' sketches by the window they describe, not by arrival time, and emits a window a grace period (5 s) after it ends. Later arrivals are counted as late.sketch_detector: turns merged windows into answers with bounds. HLL ±1.96 standard errors; KLL quantiles at q ± the normalized rank error; Count-Min lower bound = estimate − e/w·N.exact_answers: the same answers from every raw point by event-time window. It is both the ground truth and the exact baseline. Both emitasap_quantile,asap_distinct,asap_topkandasap_points, labelledmethod="sketch"or"exact", as plain OTLP gauges with labels on each point.aggregate_byis exposed in the processor config.deploy/telemetry-functions: Dockerfile,compose.yaml, stage pipelines, Prometheus (OTLP receiver plus a scrape of each engine's CPU, RSS and bytes), Grafana and Loki, andrun.sh.Result (56-core x86 server, 1-minute windows, 20,000 points/s per source)
For the busiest route, the sketch p99 was 199.5 ms against 201.7 ms exact, inside the sketch's bound of 166–295 ms. For routes with 20,000–100,000 points per window, the p99 can differ from exact by 10–40%. That is KLL's rank guarantee (about 1.3% at k = 200) in a log-normal tail, where a small rank shift is a large value shift; the bound covers it. The accuracy-vs-k experiment comes in a later PR.
Validation
Run on a 56-core x86 server with
deploy/telemetry-functions/run.sh.cargo fmt --check,cargo clippy --all-targets --features otap-engine,stream-benchmark -- -D warningsandcargo test --features otap-engine,stream-benchmarkpass at this PR's head. The end-to-end acceptance checks come in a later PR of this stack.