Skip to content

[ENH](wqs): Add queue metrics - #7669

Open
tanujnay112 wants to merge 1 commit into
mainfrom
codex/wqs-honeycomb-metrics
Open

[ENH](wqs): Add queue metrics#7669
tanujnay112 wants to merge 1 commit into
mainfrom
codex/wqs-honeycomb-metrics

Conversation

@tanujnay112

@tanujnay112 tanujnay112 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • publish low-cardinality gauges for queue depth, failed entries, aggregate
    failure count, and durable snapshot bytes
  • publish counters for PushWork, successful FinishWork, and persistence
    failures
  • refresh state gauges on queue mutations and the existing periodic
    persistence cycle
  • avoid function and collection IDs as metric attributes

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 -- --check
  • git diff --check

Rollout

Deploy this service change together with
chroma-core/k8s#3206 before
applying the Honeycomb board in
chroma-core/hosted-chroma#8328.

Publish low-cardinality queue state and activity metrics for historical
Honeycomb monitoring.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T23:57:54.516906Z 95d40a8 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +118 to +119
fn record_metrics(&self) {
let (depth, items_with_failures, failure_count) = self.state.metric_values();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

1 participant