Skip to content

ref(workerchild): add distribution metric for pending futures#671

Open
bmckerry wants to merge 1 commit into
mainfrom
task-producer-metrics
Open

ref(workerchild): add distribution metric for pending futures#671
bmckerry wants to merge 1 commit into
mainfrom
task-producer-metrics

Conversation

@bmckerry
Copy link
Copy Markdown
Member

@bmckerry bmckerry commented Jun 3, 2026

Adds a metric to get a picture of how many activations with pending futures a processing pool has.

Originally I was going to make this a gauge to get a view of the total pending activations in a processing pool, but I don't think that'd actually work (since we run many worker child processes and don't have a way to distinguish them in tags). I think making this a distribution tagged by processing pool will let us get a p95 view of how many pending activations a pool has, which is also useful.

@bmckerry bmckerry requested a review from a team as a code owner June 3, 2026 18:34
@evanh
Copy link
Copy Markdown
Member

evanh commented Jun 3, 2026

I was going to make this a gauge

You could log both? One would tell you the total/p99, and the other would tell you how many produce futures a single workerchild has to deal with.

@bmckerry bmckerry force-pushed the task-producer-metrics branch from 484f749 to 1965973 Compare June 3, 2026 18:42
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1965973. Configure here.

Comment thread clients/python/src/taskbroker_client/worker/workerchild.py Outdated
Comment thread clients/python/src/taskbroker_client/worker/workerchild.py Outdated
Copy link
Copy Markdown
Member

@untitaker untitaker left a comment

Choose a reason for hiding this comment

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

approving but one question

# Records a distribution of how many activations with pending producer futures
# a processing pool has across all worker child processes.
# Only reports if the worker actually has pending futures.
metrics.distribution(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i suspect this should be a gauge?

@bmckerry bmckerry force-pushed the task-producer-metrics branch from 1965973 to 82be624 Compare June 3, 2026 19:28
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.

3 participants