Skip to content

feat(metrics): add dispatch budget and pool worker-limit gauges (#217) - #290

Merged
shimib merged 1 commit into
llm-d:mainfrom
shimib:fix/metrics-budget-utilization
Jun 26, 2026
Merged

feat(metrics): add dispatch budget and pool worker-limit gauges (#217)#290
shimib merged 1 commit into
llm-d:mainfrom
shimib:fix/metrics-budget-utilization

Conversation

@shimib

@shimib shimib commented Jun 26, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Adds two of the unimplemented metrics from #217 — the two whose data is already available at existing hook points:

Metric Type Labels Source
llm_d_async_async_dispatch_budget Gauge queue_id,queue_name,pool_name the [0.0–1.0] value from each queue's gate
llm_d_async_async_pool_worker_limit Gauge pool_name configured worker concurrency per pool
  • Dispatch budget is emitted exactly where the flows already call gate.Budget() to size batches — redis sorted-set processMessages and gcp-pubsub requestWorker — so it's pure wiring, no new gate calls. Surfaces why throughput is throttled (gate closed → budget near 0).
  • Pool worker limit is set once from the pool config in runner.go; combined with the existing async_inflight_requests gauge it gives worker-concurrency utilization (the gap called out in [Feature]: Metrics #217's Execution Layer).

Pub/Sub budget labels mirror the existing QueueBacklog convention for that backend (queue_name=subscriberID, pool_name=poolID).

How was this tested?

  • go build ./..., make lint → 0 issues
  • go test ./pkg/metrics/... ./pkg/redis/... ./pkg/pubsub/... ./pkg/server/... → pass
  • New unit tests assert both gauges are registered and that the setters record the expected values (via testutil.ToFloat64)

Notes

Related Issues

Related: #217

Two new gauges from the metrics tracking issue (llm-d#217):

- async_dispatch_budget{queue_id,queue_name,pool_name}: the [0.0-1.0]
  value returned by each queue's gate, emitted where the flows already
  compute gate.Budget() to size batches (redis sorted-set processMessages
  and gcp-pubsub requestWorker). Surfaces why throughput is throttled.

- async_pool_worker_limit{pool_name}: the configured worker concurrency
  limit per pool, set once from the pool config in the runner. Compared
  against async_inflight_requests it yields worker utilization.

Wires both into GetAsyncProcessorCollectors, documents them in the README
metrics table, and adds unit tests.

Related: llm-d#217
Signed-off-by: Shimi Bandiel <shimib@google.com>
@shimib
shimib force-pushed the fix/metrics-budget-utilization branch from 18f6742 to 318f599 Compare June 26, 2026 16:25
@shimib
shimib merged commit e926d65 into llm-d:main Jun 26, 2026
7 checks passed
shimib added a commit to shimib/llm-d-async that referenced this pull request Jun 26, 2026
Cloud Monitoring dashboard gains panels for async_dispatch_budget (gate openness
per team), async_gate_decisions_total (by reason / team+reason), and worker
utilization (inflight / pool_worker_limit). README notes they require an image
newer than v0.7.2.

Signed-off-by: Shimi Bandiel <shimib@google.com>
@shimib shimib mentioned this pull request Jul 23, 2026
17 tasks
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.

2 participants