vector-store: add CDC reader health metrics#515
Merged
Conversation
QuerthDP
force-pushed
the
enhance-metrics-simple
branch
10 times, most recently
from
July 13, 2026 10:33
f711492 to
cae49ac
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds Prometheus metrics to surface CDC reader health per index (wide/fine), addressing cases where a CDC reader stops processing without an obvious signal.
Changes:
- Add three new exported metrics:
cdc_reader_up,cdc_handler_errors_total, andcdc_reader_restarts_total, including unit tests for export and label cleanup behavior. - Wire
Arc<Metrics>through DB/index creation into the CDC actor so CDC readers can update these metrics and clean up their series on shutdown. - Update call sites and test match arms to accommodate the new
metricsfield inDb::GetDbIndex.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/vector-store/tests/integration/db_basic.rs | Updates Db::GetDbIndex pattern matching to ignore the newly added message field. |
| crates/vector-store/src/metrics.rs | Defines/registers new CDC health metrics and adds tests for export/removal semantics. |
| crates/vector-store/src/engine.rs | Passes metrics into get_db_index during index creation. |
| crates/vector-store/src/db.rs | Extends Db::GetDbIndex / DbExt::get_db_index to carry Arc<Metrics> through to index creation. |
| crates/vector-store/src/db_index.rs | Threads metrics into CDC actor creation for each index’s readers. |
| crates/vector-store/src/db_cdc.rs | Implements CDC reader metric reporting (up, handler errors, restarts) and adds targeted tests. |
QuerthDP
force-pushed
the
enhance-metrics-simple
branch
from
July 13, 2026 11:03
cae49ac to
78d4fce
Compare
QuerthDP
marked this pull request as ready for review
July 13, 2026 11:07
ewienik
requested changes
Jul 13, 2026
`remove_index_labels` cleared `latency`/`size`/`modified` for a deleted index, but left `indexing_lag_seconds` behind, leaking a high-cardinality series per index over its lifetime.
QuerthDP
force-pushed
the
enhance-metrics-simple
branch
from
July 14, 2026 07:03
78d4fce to
578d5a2
Compare
Member
Author
|
Changelog:
|
QuerthDP
force-pushed
the
enhance-metrics-simple
branch
from
July 14, 2026 09:15
578d5a2 to
b7379dd
Compare
Member
Author
|
Changelog:
|
ewienik
requested changes
Jul 14, 2026
Passes the shared metrics registry down through the index-creation call path so CDC reader metrics can be recorded on it, rather than constructing or looking one up separately inside the CDC actor.
Give the wide/fine reader labels names (READER_WIDE, READER_FINE) instead of inline string literals, so every CDC metric can share the same label values.
Reports whether each index's CDC reader (wide/fine) is currently running or stopped, so an incident like a silently dead reader is directly observable. This is the first CDC-reader-scoped metric, so it also introduces a separate cleanup path for CDC reader labels. A reader's actor keeps running asynchronously for a while after its index is deleted, so removing its labels immediately would race with in-flight updates and just recreate the series. Each reader instead removes its own labels once it has fully, finally stopped.
Counts CDC handler errors per index and reader, alongside the existing internal `cdc-handler-errors` counter.
Counts restart after backoff attempts per index and reader, to distinguish a reader that recovers on its own from one stuck restarting.
QuerthDP
force-pushed
the
enhance-metrics-simple
branch
from
July 14, 2026 12:22
b7379dd to
1e7a3ad
Compare
Member
Author
|
Changelog:
|
ewienik
approved these changes
Jul 14, 2026
ewienik
added a commit
to ewienik/vector-store
that referenced
this pull request
Jul 14, 2026
…tamp metric (scylladb#503) Adds last Prometheus metric for CDC reader health (after scylladb#515), as a follow-up to a recent incident where a CDC reader silently stopped processing changes without any visible signal. The added metric is `cdc_last_processed_timestamp_seconds` - a cause-agnostic lag indicator showing how far each CDC reader has consumed its log window (minimum across all tracked streams), reported through a `CDCCheckpointSaver` so it keeps advancing even when the table receives no writes. Resets on generation transitions. Also splits `db_cdc` into its own module, since the actor loop and the CDC consumer were two fairly independent responsibilities sharing one large file, and this metric needed its own submodule for the `checkpoint-saver` wiring. Fixes: VECTOR-722
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.
Adds Prometheus metrics for CDC reader health, as a follow-up to a recent
incident where a CDC reader silently stopped processing changes without
any visible signal.
cdc_reader_up- whether each index's CDC reader (wide/fine) is currently running or stopped.cdc_handler_errors_total- CDC handler errors per index and reader.cdc_reader_restarts_total- restart-after-backoff attempts per index and reader.Also fixes two issues found while testing this work:
indexing_lag_secondsseries on index deletion.Split from: #503 as it kept getting bigger.
This patch will introduce the straightforward metrics that could be supported out of the box.
The latter will include the
cdc_last_processed_timestamp_secondsmetric and a potential refactor ofdb_cdc.rs.Refs: VECTOR-722
Fixes: VECTOR-739