[ENH](wqs): Add queue metrics - #7669
Conversation
Publish low-cardinality queue state and activity metrics for historical Honeycomb monitoring.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95d40a86fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fn record_metrics(&self) { | ||
| let (depth, items_with_failures, failure_count) = self.state.metric_values(); |
There was a problem hiding this comment.
Avoid rescanning the entire queue for every metric update
When the queue contains many entries, every push, finish, defer, or failure-count update now calls metric_values(), which folds over the complete pending_work deque while running on the manager's single component runtime. This adds O(queue depth) synchronous work to each request—even deduplicated pushes that do not change state—and can substantially reduce throughput or delay all other queue messages. Maintain the three aggregates incrementally when state changes, or collect them periodically instead of rescanning per request.
Useful? React with 👍 / 👎.

Summary
failure count, and durable snapshot bytes
failures
persistence cycle
Validation
cargo test -p worker work_queue::state::tests(9 passed)cargo test -p worker work_queue::work_queue_manager::tests(12 passed)cargo fmt --all -- --checkgit diff --checkRollout
Deploy this service change together with
chroma-core/k8s#3206 before
applying the Honeycomb board in
chroma-core/hosted-chroma#8328.