Skip to content

Add Horizon-equivalent dashboard for BackgroundJobs (throughput, retries, failures) #167

@antosubash

Description

@antosubash

Background

BackgroundJobs runs jobs but provides no operator UI. There is no way to inspect queue depth, throughput, failed-job payloads, or to retry/delete jobs without poking the DB. Laravel Horizon is the equivalent for Redis-queues.

Motivation

  • Ops needs visibility into the queue without SSH+SQL
  • Failed-job triage (view exception, edit payload, retry)
  • Capacity planning (throughput per queue, per job-type)

Design sketch

Add an Inertia UI section under Admin (/admin/jobs) — not a separate module since it leans on BackgroundJobs:

Pages:

  • Overview: queues, depth, throughput last 5 min / 1 h / 24 h, success vs failure rate
  • Pending: list of queued jobs with payload preview, scheduled-at
  • Running: in-flight jobs + duration
  • Failed: stack trace, payload, last-attempt-at; actions: retry / retry-all / delete
  • Completed: rolling 24 h window
  • Recurring: scheduled-job definitions (depends on the Scheduler issue)

Backend:

  • New IJobMetrics service with RecordEnqueued/Started/Completed/Failed hooks called by the runner
  • Metrics persisted as 1-minute buckets per (queue, job-type, outcome) for cheap chart aggregation
  • Failed jobs already persisted; add RetryAsync(jobId) API
  • Auth: Jobs.View and Jobs.Manage permissions

Acceptance criteria

  • IJobMetrics + bucket persistence
  • Inertia pages with Recharts (or current chart lib) charts
  • Retry / delete / bulk-retry actions
  • Permission-gated and tested
  • xUnit + integration tests
  • NBomber load test for /admin/jobs/overview
  • Docs page

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions