Repository navigation
Turn the otel-app sink into a fake backend for sketches and raw fragments - #613
Merged
Merged
Conversation
…ents The backend cannot ingest the Collector's output yet, so the sink now receives both outputs and only counts them: - OTLP/gRPC Export, decoded with the patched pdata so every sketch variant (including SumAgg) is seen; sketch data points are counted per kind and encoding, where a *Delta encoding marks a delta payload. gzip-compressed exports are accepted. - HTTP POST /ingest/gorilla, the cold fragment shipper's gzipped ASAPFRG1 frame, decoded with asap-gorilla-go to count fragments, series and samples. -dump-dir writes each request body to its own file for offline accuracy comparison. The listen address moves from a positional argument to -grpc, and -stats-every prints totals periodically.
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 backend cannot ingest the Collector's output yet. Until it can, the edge Collector's two outputs (sketch metrics over OTLP/gRPC and raw Gorilla fragments over HTTP) need somewhere to go that accepts them, reports what arrived, and can save the bodies for an offline accuracy check.
What
otel-app/sinkbecomes a fake backend that only receives:-grpc, default:4317). Sketch data points are counted per sketch kind and encoding: DDSketch, KLLSketch, CountSketch, CountMinSketch, HLLSketch and SumAgg, each with Proto/ProtoDelta/Delta/Msgpack/MsgpackDelta. Any*Deltaencoding is a delta payload, the rest are full state. Plain gauge/sum/histogram/summary points keep the existingSINK_STATScounts. The sink now accepts gzip-compressed exports.POST /ingest/gorilla(-http, default:10908, the gorilla-merger port). This takes the cold fragment shipper's gzipped ASAPFRG1 frame. The sink counts requests, gzip and decompressed bytes, fragments, distinct series and samples.-dump-dir(optional). Each request body goes to its own file,<receive-unix-ns>-<otlp|gorilla>-<seq>.bin. Without the flag, nothing is written.-stats-every(optional). Prints the totals periodically. The totals are always printed on SIGINT/SIGTERM.The sink does no merging, querying or accuracy computation.
How
pmetricotlp), the module the asapedgeprocessor encodes with (asap-precompute-go/otel.Encode). The patched proto bindings that the sink used before have no SumAgg variant, so Sum aggregations were invisible to it.otel-app/go.modgains areplace go.opentelemetry.io/collector/pdata => ../opentelemetry-collector/pdata, set up the same way as the existing opentelemetry-go and proto replaces.otel.Encodemapsprecompute.EncodingProtoDelta/EncodingMsgpackDeltato the*Deltavalues.gorilla.DecodeFragmentBatchandgorilla.DecodeFragmentSamples. Series are keyed bygorilla.FragmentLabels.ExportMetricsServiceRequestprotobuf re-marshalled from the decoded request, because gRPC decodes the message before the handler runs.-grpc. No script in the repo passed it.Before
After
To use it, point the edge Collector's OTLP exporter at
-grpcandcold.ship_endpointathttp://<sink>:10908/ingest/gorilla.Verification
TestSinkCountsAndDumpssends:otel.Encodeand exported over gzip gRPC;StreamingFragmentEncoderandEncodeFragmentBatch.It checks every counter. It also checks that the dump dir holds exactly two files whose bytes equal the sent bodies.
These were run against sketchlib-go main (cf7dac6) and again against the earlier CI pin (148643f). Both passed.