Repository navigation
storage, tsdb: add ExemplarAppenderV2 interface - #19811
Merged
Merged
Conversation
bwplotka
force-pushed
the
bwplotka/add_exemplar_appender_interface
branch
from
September 23, 2026 13:34
8e96f4b to
f39bfc7
Compare
3 tasks done
krajorama
approved these changes
Sep 28, 2026
krajorama
left a comment
Member
There was a problem hiding this comment.
LGTM
The PR description says ref!=0 does nothing in agent mode, but the code seems to suggest otherwise.
bwplotka
marked this pull request as ready for review
September 29, 2026 08:41
bwplotka
requested review from
a team,
alexgreenbank,
codesome,
cstyan,
jesusvazquez,
kgeckhart and
tomwilkie
as code owners
September 29, 2026 08:41
Signed-off-by: Bartek Plotka <[email protected]>
Fixes modernize (slicesbackward) lint errors reported by golangci-lint v2.13.1. Signed-off-by: Bartek Plotka <[email protected]>
Co-authored-by: George Krajcsovits <[email protected]> Signed-off-by: Bartlomiej Plotka <[email protected]>
Signed-off-by: Bartek Plotka <[email protected]>
bwplotka
force-pushed
the
bwplotka/add_exemplar_appender_interface
branch
from
September 29, 2026 08:49
bc7cfef to
143bdea
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.
Stacked PR: #19812
Alternative design to #19455 (per #19455 (comment)) that prepares
AppenderV2implementations for exemplar appends decoupled from the sampleAppendcall (such as Remote Write 1.0 & 2.x receivers, implemented in #19812) without:Exemplars []exemplar.Exemplarfromstorage.AppendV2Options(AppenderV2.Append), orAppendExemplarsdirectly tostorage.AppenderV2.Summary of Changes
storage: Introducestorage.ExemplarAppenderV2(mirroring the V1storage.ExemplarAppender) embeddingstorage.AppenderV2and addingAppendExemplars(ref SeriesRef, l labels.Labels, exemplars []exemplar.Exemplar) (SeriesRef, error). Exemplars appended this way stay part of the appender transaction (committed onCommit, discarded onRollback); only the call is decoupled from the sample append.tsdb:ExemplarAppenderV2onheadAppenderV2/initAppenderV2, and delegate it fromdbAppenderV2((*DB).AppenderV2) with a checked type assertion.AppendExemplarsreuses the existingheadAppenderV2.appendExemplarsvalidation path, so the inlineAppendV2Options.Exemplarsfast path stays unchanged (no extra per-append work).tsdb/agent,storage/fanout,storage/remote,cmd/prometheus,util/teststorage:ExemplarAppenderV2acrossagent.appenderV2,fanoutAppenderV2,remote.timestampTrackerV2,notReadyAppenderV2, andteststorage.appenderV2.