Skip to content

refactor(appenderV2)[FINAL PREVIEW]: move to simpler and unified storage.AppenderV2 interface#17610

Closed
bwplotka wants to merge 5 commits intomainfrom
bwplotka/appenderv2
Closed

refactor(appenderV2)[FINAL PREVIEW]: move to simpler and unified storage.AppenderV2 interface#17610
bwplotka wants to merge 5 commits intomainfrom
bwplotka/appenderv2

Conversation

@bwplotka
Copy link
Member

@bwplotka bwplotka commented Nov 25, 2025

Implements M1 from #17632

I am slowly splitting this into smaller PRs, updating #17632 on the way.

This PR is chained on:

Otherwise in this PR:

  1. We extend scrape.Manager to supports both AppendableV2 and AppendableV1 until Otel collector moves to the new interface. This the primary source of added lines, if we remove it we reduce amount of code by ~500 LOC (TODO: separate preview PR for proof)
  2. All other users switch to LimitedAppenderV1 in this PR. If they cannot (e.g. because metadata is updated), we switch to AppendableV2/AppenderV2 straight away.
  3. OTEL/PRW2 switched.

Descoped (next PRs)

  • Migrate all LimitedAppenderV1 uses in Prometheus to AppenderV2.
  • Remove scrape.Manager appender v1 flow once Otel switched.

Does this PR introduce a user-facing change?

NONE

@bwplotka bwplotka force-pushed the bwplotka/appenderv2 branch 2 times, most recently from 01c3a9d to 5246fad Compare November 25, 2025 13:03
Copy link
Member Author

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments after 1:1 with @krajorama

TL;DR (idea so far)

  • TSDB implementation now only implements AppenderV2
  • Scrape package supports both implementations (AppenderV2 and Appender). The rationale are to have less things to change to downstream (e.g. Otel does not need to do anything right now, they can change to AppenderV2 later (happy to prepare preview)).
  • Rest: I need to finish this PR to learn if there's anything else to descope/support both flows. We can then have test PRs that upgrades Prom on Thanos, Mimir, Cortex to see if there's anything else we can do to support ecosystem.

@bwplotka bwplotka force-pushed the bwplotka/appenderv2 branch 4 times, most recently from ad43b42 to 75d901d Compare November 26, 2025 09:20
@bwplotka bwplotka changed the title feat(tsdb,storage,scrape): unified and simplified storage.Appender interface refactor: move to simpler and unified storage.AppenderV2 interface Nov 26, 2025
@bwplotka bwplotka force-pushed the bwplotka/appenderv2 branch 3 times, most recently from ecaa248 to 15ddaf5 Compare November 28, 2025 07:00
Signed-off-by: bwplotka <bwplotka@gmail.com>
… (starting point)

Signed-off-by: bwplotka <bwplotka@gmail.com>
…ting point)

Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>

tmp

Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
@bwplotka bwplotka force-pushed the bwplotka/appenderv2 branch from 15ddaf5 to 652ea55 Compare December 1, 2025 10:58
@bwplotka bwplotka changed the base branch from main to bwplotka/a2-tsdb December 1, 2025 11:00
@bwplotka bwplotka changed the title refactor: move to simpler and unified storage.AppenderV2 interface refactor(appenderV2)[FINAL PREVIEW]: move to simpler and unified storage.AppenderV2 interface Dec 1, 2025
@bwplotka bwplotka force-pushed the bwplotka/a2-tsdb branch 3 times, most recently from 3e22da5 to a1d088e Compare December 1, 2025 18:20
@bwplotka bwplotka force-pushed the bwplotka/a2-tsdb branch 3 times, most recently from 9a7fc9e to 96308f4 Compare December 3, 2025 10:56
@bwplotka bwplotka force-pushed the bwplotka/a2-tsdb branch 10 times, most recently from 5d05dcf to e7e4509 Compare December 9, 2025 10:39
Base automatically changed from bwplotka/a2-tsdb to main December 9, 2025 11:41
@roidelapluie
Copy link
Member

I would like to see scrape and prometheus continuing to support v1. It seems like OTLP would be benefitting most from the v2 appender right now. We could have helpers to help with v1-v2 if that is needed, but the changes in some areas like scrape seem really high.

We could move everything to v2 appender in Prometheus v4, once we are confident it is better. It will lower the technical debt.

@bwplotka
Copy link
Member Author

Closing as things changed a lot since then. I tried to address your feedback @roidelapluie in #17632 (comment), let's continue the discussion there.

@bwplotka bwplotka closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants