Skip to content

feat: metrics/health endpoint at GET /jobs/metrics.json#46

Merged
eclectic-coding merged 4 commits into
mainfrom
feat/metrics-endpoint
May 21, 2026
Merged

feat: metrics/health endpoint at GET /jobs/metrics.json#46
eclectic-coding merged 4 commits into
mainfrom
feat/metrics-endpoint

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • Adds GET /jobs/metrics.json — a JSON-only endpoint for Prometheus scraping, uptime monitors, and external dashboards
  • Response includes job counts (ready/scheduled/claimed/blocked/failed), throughput (completed_1h/24h), per-queue depth and paused state, and process health (total/healthy/stale/by_kind)
  • slow_jobs count included when slow_job_threshold is configured
  • Goes through the same authentication and connects_to middleware as all other routes — no special casing needed

Test plan

  • 13 new request examples covering all response fields, slow_jobs conditional, healthy/stale process counts, and auth
  • 234 examples, 0 failures, 99.79% line coverage
  • bundle exec rake passes (RuboCop + RSpec)

🤖 Generated with Claude Code

eclectic-coding and others added 2 commits May 21, 2026 09:56
Adds a JSON-only endpoint exposing job counts (ready/scheduled/claimed/
blocked/failed), throughput (completed_1h/24h), per-queue depth and paused
status, and process health (total/healthy/stale/by_kind). When
slow_job_threshold is configured, a slow_jobs count is also included.
Goes through the same auth and connects_to middleware as all other routes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0fa2db6) to head (e1910f0).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #46   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        26    +2     
  Lines          464       496   +32     
=========================================
+ Hits           464       496   +32     
Files with missing lines Coverage Δ
.../controllers/solid_queue_web/metrics_controller.rb 100.00% <100.00%> (ø)
app/services/solid_queue_web/metrics_payload.rb 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

eclectic-coding and others added 2 commits May 21, 2026 09:59
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves all query and aggregation logic into a dedicated service object,
matching the DashboardStats/QueueStats pattern. Controller becomes a
single render call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eclectic-coding eclectic-coding merged commit e364239 into main May 21, 2026
7 checks passed
@eclectic-coding eclectic-coding deleted the feat/metrics-endpoint branch May 21, 2026 14:03
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