Skip to content

salbertson/nifty-alert-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NiftyAlert

The gem will let you report when something reaches a threshold, such as a job queue, and will intelligently alert whoever or whatever is configured to receive alerts.

Installation

Add this line to your application's Gemfile:

gem 'nifty_alert'

Or install it yourself as:

$ gem install nifty_alert

Usage

Set up recipients, maybe in a Rails initializer. Recipients can be Slack channels, with email support coming soon.

NiftyAlert.recipients = [
  "https://mycompany.slack.com/services/hooks/slackbot?token=123abc4567def&channel=%23dev"
]

Report whatever you would like to monitor, such as the number of jobs in your queue, along with a threshold:

class EmailJob
  def before(job)
    nifty_alert = NiftyAlert.new(:job_queue)
    nifty_alert.report(Delayed::Job.count, 1_000)
  end

  ...
end

If the threshold has been reached, your Slack channel will be notified.

Don't worry, NiftyAlert will only alert you of an overage once every 15 minutes.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/nifty_alert/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Keep an eye on anything with a threshold, especially queues.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages