Repository navigation
Conversation
Port the Remote Write 2.x receiver path (writeHandler.writeV2 / appendV2) from V1 storage.Appender to storage.AppenderV2, matching the RW 1.0 path. - Start timestamps are now passed directly as the AppenderV2.Append st parameter; the appender owns ST zero-sample injection, so the explicit AppendSTZeroSample / AppendHistogramSTZeroSample calls (and the handleHistogramZeroSample helper) are removed. The receiver still gates on ingestSTZeroSample, preserving prior behaviour. - Metadata is attached via AppendV2Options.Metadata on the first sample/histogram append of each series; if that append is rejected, metadata is dropped with it. It is best-effort: Append no longer reports metadata errors, so samplesAppendedWithoutMetadata is no longer incremented on this path (the metric stays registered and is still used by the RW 1.0 path). - Exemplars are collected per series, sorted by timestamp, and appended in one batched AppendExemplars call instead of a per-exemplar loop. Out-of-order exemplars still map to a 400; other exemplar errors remain a no-op, preserving prior behaviour. With both RW 1.0 and 2.x on AppenderV2, the V1 appendable is no longer used by the receiver: NewWriteHandler drops its storage.Appendable parameter and the now-dead remoteWriteAppender wrapper is removed. Part of #17632. Signed-off-by: György Krajcsovits <[email protected]>
Member
Author
|
we might be able to do it simply in one PR, closing this for now |
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 of #17632. Stacked on top of #19457 (RW 1.0 migration) — base branch is
krajo/rw1-receiver-appenderv2-v2, so review only the top commit here.What
The Remote Write 2.x receiver path (
writeHandler.writeV2/appendV2) is ported from V1storage.Appendertostorage.AppenderV2, matching the RW 1.0 path from #19457.This folds together what #19251 and #19252 did separately, since the reason they were split (avoiding a per-exemplar interface call) no longer applies —
AppendExemplarsis mandatory and batched on this stack (#19455), so there's no standalone-vs-inline tradeoff to make for exemplars anymore:AppenderV2.Appendstparameter; the appender owns ST zero-sample injection, so the explicitAppendSTZeroSample/AppendHistogramSTZeroSamplecalls (and thehandleHistogramZeroSamplehelper) are removed. The receiver still gates oningestSTZeroSample, preserving prior behaviour.AppendV2Options.Metadataon the first sample/histogram append of each series (same approach storage/remote: pass RW 2.0 exemplars and metadata via AppendV2Options #19252 took) — if that append is rejected, metadata is dropped with it. It's best-effort:Appendno longer reports metadata errors, sosamplesAppendedWithoutMetadatais no longer incremented on this path (the metric stays registered and is still used by the RW 1.0 path).AppendExemplars's contract), and appended in one batchedAppendExemplarscall instead of a per-exemplar loop. Out-of-order exemplars still map to a 400; other exemplar errors remain a no-op — preserving prior behaviour.With both RW 1.0 and 2.x on
AppenderV2, the V1 appendable is no longer used by the receiver:NewWriteHandlerdrops itsstorage.Appendableparameter and the now-deadremoteWriteAppenderwrapper is removed.Tests
mockAppenderV2.Appendnow mirrors what a realAppenderV2implementation does internally: it injects the ST zero-sample (via the existing V1 mock methods) whenst != 0, and records metadata viaopts.Metadatawhen present — both best-effort, matching production semantics. Added a case exercising metadata stored viaAppendV2Options(appendMetadata: true), which wasn't previously covered — the existing table only tested the disabled case.