Merge pull request #546 from metamaps/feature/exception-notification
slack exception notifications
This commit is contained in:
commit
da0da1a117
4 changed files with 80 additions and 42 deletions
|
@ -16,14 +16,17 @@ export DEVISE_SECRET_KEY='f71c467e526f23d614b3b08866cad4788c502bed869c282f06e73e
|
||||||
# export AWS_ACCESS_KEY_ID
|
# export AWS_ACCESS_KEY_ID
|
||||||
# export AWS_SECRET_ACCESS_KEY
|
# export AWS_SECRET_ACCESS_KEY
|
||||||
# export SSO_KEY
|
# export SSO_KEY
|
||||||
#
|
#
|
||||||
# export SMTP_DOMAIN
|
# export SMTP_DOMAIN
|
||||||
# export SMTP_PASSWORD
|
# export SMTP_PASSWORD
|
||||||
# export SMTP_PORT
|
# export SMTP_PORT
|
||||||
# export SMTP_SERVER
|
# export SMTP_SERVER
|
||||||
# export SMTP_USERNAME
|
# export SMTP_USERNAME
|
||||||
|
|
||||||
|
# # send exception notifications to a slack incoming webhook
|
||||||
|
# export SLACK_EN_WEBHOOK_URL
|
||||||
|
|
||||||
#ruby garbage collection stuff
|
# ruby garbage collection stuff
|
||||||
|
|
||||||
export RUBY_GC_TUNE=0 #set to 1 to enable GC test
|
export RUBY_GC_TUNE=0 #set to 1 to enable GC test
|
||||||
export RUBY_GC_TOKEN=4f4380fc9a2857d1f008005a3eb86928
|
export RUBY_GC_TOKEN=4f4380fc9a2857d1f008005a3eb86928
|
||||||
|
|
72
Gemfile
72
Gemfile
|
@ -3,67 +3,59 @@ ruby '2.1.3'
|
||||||
|
|
||||||
gem 'rails', '4.2.4'
|
gem 'rails', '4.2.4'
|
||||||
|
|
||||||
|
gem 'active_model_serializers', '~> 0.8.1'
|
||||||
|
gem 'aws-sdk', '< 2.0'
|
||||||
|
gem 'best_in_place' #in-place editing
|
||||||
|
gem 'delayed_job', '~> 4.0.2'
|
||||||
|
gem 'delayed_job_active_record', '~> 4.0.1'
|
||||||
gem 'devise'
|
gem 'devise'
|
||||||
gem 'redis'
|
gem 'doorkeeper'
|
||||||
|
gem 'dotenv'
|
||||||
|
gem 'exception_notification'
|
||||||
|
gem 'formtastic'
|
||||||
|
gem 'formula'
|
||||||
|
gem 'httparty'
|
||||||
|
gem 'json'
|
||||||
|
gem 'kaminari' # pagination
|
||||||
|
gem 'paperclip'
|
||||||
gem 'pg'
|
gem 'pg'
|
||||||
gem 'pundit'
|
gem 'pundit'
|
||||||
gem 'pundit_extra'
|
gem 'pundit_extra'
|
||||||
gem 'doorkeeper'
|
|
||||||
gem 'formula'
|
|
||||||
gem 'formtastic'
|
|
||||||
gem 'json'
|
|
||||||
gem 'rails3-jquery-autocomplete'
|
|
||||||
gem 'best_in_place' #in-place editing
|
|
||||||
gem 'kaminari' # pagination
|
|
||||||
gem 'uservoice-ruby'
|
|
||||||
gem 'dotenv'
|
|
||||||
gem 'snorlax'
|
|
||||||
gem 'rack-cors'
|
gem 'rack-cors'
|
||||||
gem 'httparty'
|
gem 'rails3-jquery-autocomplete'
|
||||||
gem 'active_model_serializers', '~> 0.8.1'
|
gem 'redis'
|
||||||
gem 'delayed_job', '~> 4.0.2'
|
gem 'slack-notifier'
|
||||||
gem 'delayed_job_active_record', '~> 4.0.1'
|
gem 'snorlax'
|
||||||
|
gem 'uservoice-ruby'
|
||||||
gem 'paperclip'
|
|
||||||
gem 'aws-sdk', '< 2.0'
|
|
||||||
|
|
||||||
gem 'jquery-rails'
|
gem 'jquery-rails'
|
||||||
gem 'jquery-ui-rails'
|
gem 'jquery-ui-rails'
|
||||||
gem 'jbuilder'
|
gem 'jbuilder'
|
||||||
|
|
||||||
#gem 'therubyracer' #optional
|
|
||||||
#gem 'rb-readline'
|
|
||||||
|
|
||||||
# Gems used only for assets and not required
|
|
||||||
# in production environments by default.
|
|
||||||
group :assets do
|
group :assets do
|
||||||
gem 'sass-rails'
|
|
||||||
gem 'coffee-rails'
|
gem 'coffee-rails'
|
||||||
|
gem 'sass-rails'
|
||||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
|
||||||
# gem 'therubyracer'
|
|
||||||
|
|
||||||
gem 'uglifier'
|
gem 'uglifier'
|
||||||
|
# gem 'therubyracer'
|
||||||
end
|
end
|
||||||
|
|
||||||
group :test do
|
group :production do
|
||||||
gem 'rspec-rails'
|
|
||||||
gem 'factory_girl_rails'
|
|
||||||
gem 'shoulda-matchers'
|
|
||||||
gem 'simplecov', require: false
|
|
||||||
gem 'json-schema'
|
|
||||||
end
|
|
||||||
|
|
||||||
group :production do #this is used on heroku
|
|
||||||
#gem 'rmagick'
|
|
||||||
gem 'rails_12factor'
|
gem 'rails_12factor'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
group :test do
|
||||||
|
gem 'factory_girl_rails'
|
||||||
|
gem 'json-schema'
|
||||||
|
gem 'rspec-rails'
|
||||||
|
gem 'shoulda-matchers'
|
||||||
|
gem 'simplecov', require: false
|
||||||
|
end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'pry-rails'
|
|
||||||
gem 'pry-byebug'
|
|
||||||
gem 'better_errors'
|
gem 'better_errors'
|
||||||
gem 'binding_of_caller'
|
gem 'binding_of_caller'
|
||||||
|
gem 'pry-byebug'
|
||||||
|
gem 'pry-rails'
|
||||||
gem 'quiet_assets'
|
gem 'quiet_assets'
|
||||||
gem 'tunemygc'
|
gem 'tunemygc'
|
||||||
end
|
end
|
||||||
|
|
|
@ -89,6 +89,9 @@ GEM
|
||||||
railties (>= 3.2)
|
railties (>= 3.2)
|
||||||
dotenv (2.1.0)
|
dotenv (2.1.0)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
|
exception_notification (4.1.4)
|
||||||
|
actionmailer (~> 4.0)
|
||||||
|
activesupport (~> 4.0)
|
||||||
execjs (2.6.0)
|
execjs (2.6.0)
|
||||||
ezcrypto (0.7.2)
|
ezcrypto (0.7.2)
|
||||||
factory_girl (4.5.0)
|
factory_girl (4.5.0)
|
||||||
|
@ -229,6 +232,7 @@ GEM
|
||||||
json (~> 1.8)
|
json (~> 1.8)
|
||||||
simplecov-html (~> 0.10.0)
|
simplecov-html (~> 0.10.0)
|
||||||
simplecov-html (0.10.0)
|
simplecov-html (0.10.0)
|
||||||
|
slack-notifier (1.5.1)
|
||||||
slop (3.6.0)
|
slop (3.6.0)
|
||||||
snorlax (0.1.5)
|
snorlax (0.1.5)
|
||||||
rails (> 4.1)
|
rails (> 4.1)
|
||||||
|
@ -270,6 +274,7 @@ DEPENDENCIES
|
||||||
devise
|
devise
|
||||||
doorkeeper
|
doorkeeper
|
||||||
dotenv
|
dotenv
|
||||||
|
exception_notification
|
||||||
factory_girl_rails
|
factory_girl_rails
|
||||||
formtastic
|
formtastic
|
||||||
formula
|
formula
|
||||||
|
@ -296,6 +301,7 @@ DEPENDENCIES
|
||||||
sass-rails
|
sass-rails
|
||||||
shoulda-matchers
|
shoulda-matchers
|
||||||
simplecov
|
simplecov
|
||||||
|
slack-notifier
|
||||||
snorlax
|
snorlax
|
||||||
tunemygc
|
tunemygc
|
||||||
uglifier
|
uglifier
|
||||||
|
|
37
config/initializers/exception_notification.rb
Normal file
37
config/initializers/exception_notification.rb
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
require 'exception_notification/rails'
|
||||||
|
|
||||||
|
ExceptionNotification.configure do |config|
|
||||||
|
# Ignore additional exception types.
|
||||||
|
# ActiveRecord::RecordNotFound, AbstractController::ActionNotFound and
|
||||||
|
# ActionController::RoutingError are already added.
|
||||||
|
config.ignored_exceptions += %w(
|
||||||
|
ActionView::TemplateError CustomError UnauthorizedException
|
||||||
|
InvalidArgumentException InvalidEntityException InvalidRequestException
|
||||||
|
NotFoundException ValidationException
|
||||||
|
)
|
||||||
|
|
||||||
|
# Adds a condition to decide when an exception must be ignored or not.
|
||||||
|
# The ignore_if method can be invoked multiple times to add extra conditions.
|
||||||
|
config.ignore_if do |_exception, _options|
|
||||||
|
!Rails.env.production?
|
||||||
|
end
|
||||||
|
|
||||||
|
# Notifiers ######
|
||||||
|
|
||||||
|
if ENV['SLACK_EN_WEBHOOK_URL']
|
||||||
|
config.add_notifier :slack, webhook_url: ENV['SLACK_EN_WEBHOOK_URL']
|
||||||
|
end
|
||||||
|
|
||||||
|
# Email notifier sends notifications by email.
|
||||||
|
# config.add_notifier :email, {
|
||||||
|
# :email_prefix => "[ERROR] ",
|
||||||
|
# :sender_address => %{"Notifier" <notifier@example.com>},
|
||||||
|
# :exception_recipients => %w{exceptions@example.com}
|
||||||
|
# }
|
||||||
|
|
||||||
|
# Webhook notifier sends notifications over HTTP protocol. Requires 'httparty' gem.
|
||||||
|
# config.add_notifier :webhook, {
|
||||||
|
# :url => 'http://example.com:5555/hubot/path',
|
||||||
|
# :http_method => :post
|
||||||
|
# }
|
||||||
|
end
|
Loading…
Reference in a new issue