Repository navigation
Conversation
The urn:asap:exporter:sink exporter counts the sketch envelopes it receives per ASAPv1 kind id (messages and payload bytes) plus plain points, optionally writes each received batch as an OTLP protobuf file to dump_dir, and prints the totals on shutdown and every stats_every. configs/sink.yaml runs it behind an OTLP receiver; configs/collector.yaml runs asap_sketches and exports to it.
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.
Why
The Rust collector (
asap-precompute-rs,asap_sketcheson the OTAP dataflow engine) emits one ASAPv1 sketch envelope per series per tumbling window. The real backend cannot ingest these yet, so the outputs need a fake backend. It should count what arrives and, when asked, keep it on disk so an offline script can compare sketch answers with exact answers. The Go sink inotel-app/sink/does this for the Go collector's modified-OTLP sketch types. It does not read ASAPv1 kind ids, and it runs as a separate gRPC server.What
urn:asap:exporter:sink(src/otap/sink.rs). It is registered in the same way as the other ASAP nodes, soasap-collectorcan run it.fullordelta;dump_dirset, it writes each received batch to its own file before decoding it:<receive-unix-ns>-<seq>.pb, an OTLPExportMetricsServiceRequestprotobuf. Withoutdump_dir, it writes nothing.stats_everywhen that is set.configs/sink.yaml: OTLP/HTTP receiver on:4319→ sink.configs/collector.yaml: OTLP/HTTP receiver on:4318→asap_sketches(one DDSketch per route per 10 s window) → OTLP/HTTP exporter to the sink.asap-collectordoc comment now list the sink.The sink adds no gRPC or HTTP server code: the upstream OTLP or OTAP receiver feeds it inside its own engine process. Raw XOR chunks are not handled yet; that is a later step. The Go sink in
otel-app/sink/now does the same job and is kept for now. It will be deleted once the Rust path is verified end to end.raw_sinkwas checked first and not extended. It is a processor that ends the raw baseline pipeline: it writes raw points to a log store and reports acknowledgement latency gauges. It does not count sketch envelopes, and sharing that node would mix two unrelated jobs.How
codec::decode_each. Each observation that carries an envelope is counted byasap_sketchlib::peek_kind_idon its payload. That function checks the magic, version and framing, and parses neither the metadata nor the payload.failed.OtlpProtoBytesand those bytes are written. The file therefore holds the whole batch: labels, window bounds, resource attributes and sketch bytes.info.Key code interfaces
Usage
Major algorithm changes
None.
Before
Nothing in
asap-precompute-rscould receive the collector's sketch output. The only fake backend was the Go sink, which does not read ASAPv1 kind ids.After
Two
asap-collectorprocesses, collector and sink, run the full path. The sink prints, for example:Verification
cargo fmt --check: clean.cargo clippy --all-targets --all-features: no warnings.cargo test --all-features: all pass (lib 100 passed and 1 ignored, stream_bench 6, kll_windows 11, otap_pipeline_e2e 1, runtime 26).New test
otap::sink::tests::counts_kinds_and_plain_points_and_dumps_each_batch. It sends two batches, each holding a full DDSketch (05 01), a Count-Min (02 00) and one plain gauge, to a sink withdump_dirset to a temp dir. It then checks:<ns>-1.pband<ns>-2.pb;The collector produces no delta kind, so the test uses two full kinds.
Local run:
scenario_generator(2000 points/s, 20 routes) →configs/collector.yaml→ sink (configs/sink.yamlplusdump_dir). Over about 50 s, the sink received 5 batches with 20 DDSketch envelopes each (one per route per 10 s window), and no batch failed. It wrote 5 dump files and printed the totals every 10 s and on shutdown.