Repository navigation
Conversation
Part of the migration off the V1 storage.Appender interface (#17632). AppenderV2 so far only exposed Append, with exemplars and metadata carried through AppendV2Options. Callers structured around the V1 standalone AppendExemplar/UpdateMetadata calls (e.g. the remote-write receiver) cannot be ported mechanically to that model. This adds two new V2-scoped interfaces, ExemplarAppenderV2 and MetadataUpdaterV2, embedded into AppenderV2, mirroring the V1 ExemplarAppender/MetadataUpdater sub-interfaces. The AppendV2Options.Exemplars and .Metadata fields remain; both entry points feed the same per-series batch. The methods are implemented on every concrete V2 appender: - tsdb head: AppendExemplar/UpdateMetadata moved to the shared headAppenderBase so both V1 and V2 appenders share them; initAppenderV2 gains delegating variants. - tsdb agent: the two methods moved to the shared appenderBase. - fanoutAppenderV2 delegates to primary and secondaries. - remote-write timestampTrackerV2 counts exemplars, metadata is a no-op. - notReadyAppenderV2 returns ErrNotReady. - teststorage and the noOpAppender test mock record/no-op as appropriate. This change is additive; no existing behaviour changes. Signed-off-by: György Krajcsovits <[email protected]> Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: György Krajcsovits <[email protected]>
Member
Author
|
I like the alternative #19250 better to not enforce changes on downstream. |
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.
What
AppenderV2so far only exposedAppend, with exemplars and metadata carried throughAppendV2Options. Callers structured around the V1 standaloneAppendExemplar/UpdateMetadatacalls (e.g. the remote-write receiver) cannot be ported mechanically to that model.This adds two new V2-scoped interfaces,
ExemplarAppenderV2andMetadataUpdaterV2, embedded intoAppenderV2, mirroring the V1ExemplarAppender/MetadataUpdatersub-interfaces. TheAppendV2Options.Exemplarsand.Metadatafields remain; both entry points feed the same per-series batch.The methods are implemented on every concrete V2 appender:
AppendExemplar/UpdateMetadatamoved to the sharedheadAppenderBaseso both V1 and V2 appenders share one implementation;initAppenderV2gains delegating variants.appenderBase.timestampTrackerV2: counts exemplars, metadata is a no-op (matching V1).ErrNotReady.noOpAppendertest mock: record / no-op as appropriate.This change is additive; no existing behaviour changes.
Why
Preparatory step for migrating the remote-write receiver (starting with RW 1.0) off the V1
storage.Appender. A follow-up PR will use these methods to switch the receiver toAppenderV2.Tests
testAppendableV2(also exercises.Thenchaining) to cover the new standalone methods.TestHeadAppenderV2_AppendExemplarAndUpdateMetadataverifying the exemplar viaExemplarQuerierand the metadata via the series' stored metadata.