Add latency metric for backfilling replication history events#10918
Open
xwduan wants to merge 3 commits into
Open
Add latency metric for backfilling replication history events#10918xwduan wants to merge 3 commits into
xwduan wants to merge 3 commits into
Conversation
Measure the time taken by bringLocalEventsUpToSourceCurrentBranch, tagged by namespace, via replication_backfill_events_latency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve the namespace once at the top for the latency metric tag and reuse it, removing the redundant second lookup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Keep namespace lookup on the append path (as before) and capture the name for the metric tag via a variable, so early-return paths don't trigger unexpected mock calls. Add GetMetricsHandler expectations to the bringLocalEvents shard mocks. Co-Authored-By: Claude Opus 4.8 (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.
What
Adds a timer metric
replication_backfill_events_latencythat measures how longbringLocalEventsUpToSourceCurrentBranchtakes to execute during workflow state replication (backfilling history events).The metric is recorded via a
deferso it captures every return path (including early returns and errors) and is tagged with the namespace name.Why
We currently have no visibility into how long backfilling replication history events takes. This metric surfaces that latency per-namespace.
🤖 Generated with Claude Code