Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.
/ resque-brain Public archive

NOT MAINTAINED [ Better resque-web that can monitor multiple Resque's in one place ]

License

Notifications You must be signed in to change notification settings

stitchfix/resque-brain

Repository files navigation

resque-brain: a better resque-web

This app is no longer maintained

  • If you would like to take ownership of this app, please reach out to us.
  • We still use this app internally, but it's too difficult to maintain as open source while also making it work with our internal deployment tools.

resque-brain is a web app to monitor and manage multiple Resque instances. It is superior to resque-web in three important ways:

  • it can monitor any number of resque instances, instead of just one (see the wiki for why you'd want to do that).
  • it allows for "retry & clear" on failed jobs, to re-queue the job and remove it from the failed queue in one step
  • it has a responsive design, thus working on mobile browsers

Other Features

  • Include rake tasks to monitor the health of your resque instances
  • UI focused on issues, not just dumping the contents of the queues:
    • stale workers
    • large queues
    • failed jobs
  • View resque-scheduler schedule and manually queue jobs

Planned Features

  • Visibility into delayed and retry queues, if using
  • Extensibility

UI

Summary of all monitored Resques

The home page gives you a summary of all resques you have configured

Summary

Overview of the Resque instance

Drilling into a single Resque, you get quick overview of what's going on, namely how many jobs are working, waiting, and failed.

Overview

Jobs currently running

This shows only which jobs are actually running, and when they started. Jobs running "too long" are called out.

Jobs Running

Jobs waiting

This shows all the queues and how many jobs are in each one. Any queue with a nonzero number of jobs is highlighted so you can hone in on exactly what you care about.

Jobs Waiting

Failed queue

We see a more readable summary of what's going on, along with direct links to search google for the problem. We also have the ability to retry and clear at the same time. So many newcomers to Resque think that retry does a clear, and are baffled when the job "fails again" (i.e. stays in the failed queue).

Failed Queue

We can expand to see exceptions

Exception View

Schedule

Scheduler

Mobile View

The design is completely responsive, meaning you can tend to your queues while on the go.

Mobile View

Running

See Set Up on the wiki.

Local Development

You'll need to do three things:

  • Install Bower (which requires npm, which requires node)

  • Install PhantomJS

  • Set up your environment:

    Easiest thing is to create a .env like so:

    RESQUE_BRAIN_INSTANCES=localhost
    RESQUE_BRAIN_INSTANCES_localhost=redis://localhost:6379
    HTTP_AUTH_USERNAME=a
    HTTP_AUTH_PASSWORD=a
    

    Then:

    > foreman start
    

    The app will be running on http://localhost:5000

To run tests:

> rake test # run server-side tests
> rake teaspoon # run JavaScript tests

Rake Tasks for Monitoring

See the Set Up page on the wiki, as well as Monitoring & Alerting for a discussion of how its set up.

Limitations

  • This only works with the default Redis-based Failure backend. It does work with resque-retry because resque-retry defers to that backend. I don't believe you should use the other back-ends.
  • Just as with resque-web, if multiple people are manipulating the failed queue at the same time bad things will happen. This is a function of the poor design of the failed queue implementation. Be warned.
  • The Web UI is not extensible, so currently this is no visibility into resque-scheduler or resque-retry.