Skip to content

feat(webapp,run-engine,core,clickhouse): surface total concurrency in metrics and dashboard - #4830

Open
matt-aitken wants to merge 2 commits into
feat/queue-concurrency-overridesfrom
feat/queue-concurrency-metrics
Open

feat(webapp,run-engine,core,clickhouse): surface total concurrency in metrics and dashboard#4830
matt-aitken wants to merge 2 commits into
feat/queue-concurrency-overridesfrom
feat/queue-concurrency-metrics

Conversation

@matt-aitken

Copy link
Copy Markdown
Member

Summary

Queues with a totalConcurrencyLimit now show how they use it, in the dashboard and the API. Stacked on #4829.

The queues list gains a Total column showing runs in flight across all concurrency keys against the queue's total cap, turning warning-colored when the cap is reached. The queue detail page gains a "Total concurrency" chart plotting total running against the effective cap over time, and the per-key table gains a Limit column that shows each key's effective concurrency limit, highlighting keys with a per-key override. Queue retrieve and list API responses include the same totals under concurrency.total.

Design

The queue metrics gauge (emitted from the dequeue and enqueue Lua scripts) is extended with two fields: total running (the group concurrency set's cardinality) and the raw stored total limit. They flow through the existing metrics stream into the ClickHouse raw table and are aggregated as max_total_running / max_total_limit in the 10s and 5m rollup tiers, queryable from the dashboard's TRQL widgets. The per-key rollup additionally records each key's effective limit so overrides are visible historically.

Reading the live numbers is O(pages shown): the list presenter batches one SCARD per queue that has a cap, and the per-key table reads the queue's override hash once per page.

… metrics and dashboard

Queues with a totalConcurrencyLimit now report how they use it. The gauge
pipeline emits total running and the stored cap, ClickHouse aggregates them
into the queue metrics tiers, the queues list gets a Total column, the queue
detail page charts total running against the cap, and the per-key table shows
each key's effective limit including per-key overrides. Queue retrieve and
list API responses include the same totals.
@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f5ad5d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
@trigger.dev/core Patch
@trigger.dev/build Patch
trigger.dev Patch
@trigger.dev/python Patch
@trigger.dev/redis-worker Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@internal/metrics-pipeline Patch
@trigger.dev/rbac Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/run-store Patch
@internal/schedule-engine Patch
@internal/tracing Patch
@internal/webhook-engine Patch
@internal/webhook-sources Patch
@internal/dashboard-agent Patch
@internal/cache Patch
@trigger.dev/react-hooks Patch
@trigger.dev/rsc Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch
@trigger.dev/sso Patch
@internal/testcontainers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 32a1769f-9545-4873-8bd1-ebd28da432cd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

devin-ai-integration[bot]

This comment was marked as resolved.

…tore views on rollback

The CK enqueue gauges (fast path and queued path) now sample total running
and the stored cap, so metric buckets fed only by enqueues no longer record
zero totals. The migration's down section recreates the pre-existing
materialized view definitions so ingestion keeps flowing after a rollback.
The per-key table reads only the page's overrides with one HMGET instead of
loading the queue's whole override hash.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 0 new potential issues.

Devin Review

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