Skip to content

faultline exception and error notifier for Rack application

License

Notifications You must be signed in to change notification settings

faultline/faultline-rack

Repository files navigation

Faultline::Rack Build Status

faultline exception and error notifier for Rack application.

Installation

Add this line to your application's Gemfile:

gem 'faultline-rack'

And then execute:

$ bundle

Or install it yourself as:

$ gem install faultline-rack

Usage

config/application.rb

require 'faultline/rack'

Faultline.configure do |c|
  c.project = 'faultline-rack'
  c.api_key = 'xxxxXXXXXxXxXXxxXXXXXXXxxxxXXXXXX'
  c.endpoint = 'https://xxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/v0'
  c.notifications = [
    {
      type: 'slack',
      endpoint: 'https://hooks.slack.com/services/XXXXXXXXXX/B2RAD9423/WC2uTs3MyGldZvieAtAA7gQq',
      channel: '#random',
      username: 'faultline-notify',
      notifyInterval: 1,
      threshold: 1,
      timezone: 'Asia/Tokyo'
    },
    {
      type: 'github',
      userToken: 'XXXXXXXxxxxXXXXXXxxxxxXXXXXXXXXX',
      owner: 'k1LoW',
      repo: 'faultline',
      labels: [
        'faultline', 'bug'
      ],
      if_exist: 'reopen-and-comment',
      notifyInterval: 1,
      threshold: 1,
      timezone: 'Asia/Tokyo'
    }
  ]
end

[...]

module MyApp
  class Application < Rails::Application
    config.middleware.use Faultline::Rack::Middleware
  end
end

References

License

MIT © Ken'ichiro Oyama