Add chain-entry counter and dispatcher-level metrics#159
Merged
Conversation
Three additions in conserver/main.py to give us a complete view of the chain
without depending on every backend remembering to self-instrument:
- count_vcons_received{ingress_list} after r.blpop, paired with the
existing count_vcons_processed for a true completion ratio
- conserver.storage.count{backend, outcome} + duration_ms histogram in
_process_storage, covering all backends uniformly
- conserver.link.count{link_name, outcome} on both success and error
paths in _process_link
Existing per-backend metrics (milvus, supabase_direct, etc.) keep firing
unchanged - the dispatcher metrics are additive.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Three OTel metric additions in
conserver/main.pyto give a complete view of chain processing independent of per-backend instrumentation coverage.conserver.main_loop.count_vcons_received{ingress_list}afterr.blpop— pairs with the existingcount_vcons_processedto compute a true completion ratio, and to detect a stall (received > 0 AND processed == 0).conserver.storage.count{backend, outcome}andconserver.storage.duration_ms{backend}in_process_storage— uniform metrics across all storage backends, regardless of whether the backend's own code emits.conserver.link.count{link_name, outcome}on both success and error paths of_process_link— same shape, dispatcher-level.Existing per-backend metrics (
milvus,supabase_direct, etc.) keep firing unchanged; the dispatcher metrics are additive.Why
Today only ~3 of 16 storage backends and ~11 of 23 link backends emit error counters of their own. Wrapping at the dispatcher gives a single source of truth for "did this backend fail" without having to backfill instrumentation across 25 modules.
Test plan