Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
Add setup/config for Sentry error reporting
Browse files Browse the repository at this point in the history
We're using Sentry for error capture here at nested.  Would be good to
track errors like our other in-house applications.
  • Loading branch information
dazoakley committed Jul 13, 2018
1 parent 9eb5c1c commit b2ab229
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
28 changes: 12 additions & 16 deletions Gemfile
@@ -1,27 +1,23 @@
source 'https://rubygems.org'

gem 'rake'
gem 'airbrake', require: false
gem 'dotenv'

gem 'sequel'
gem 'mysql2', platform: :ruby
gem 'pg', platform: :ruby
gem 'erubis'
gem 'jdbc-mysql', platform: :jruby
gem 'jdbc-postgres', platform: :jruby

gem 'sinatra'
gem 'rack-flash3'
gem 'erubis'
gem 'macmillan-utils'
gem 'lru_redux'

gem 'macmillan-utils'
gem 'mysql2', platform: :ruby
gem 'nokogiri', '~> 1.8.2'
gem 'pg', platform: :ruby
gem 'puma', require: false

gem 'airbrake', require: false
gem 'statsd-ruby', require: false
gem 'rack-cors'

gem 'nokogiri', '~> 1.8.2'
gem 'rack-flash3'
gem 'rake'
gem 'sentry-raven', require: false
gem 'sequel'
gem 'sinatra'
gem 'statsd-ruby', require: false

group :development do
gem 'shotgun'
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Expand Up @@ -32,6 +32,8 @@ GEM
docile (1.1.5)
dotenv (2.2.1)
erubis (2.7.0)
faraday (0.15.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.21)
ffi (1.9.21-java)
formatador (0.2.5)
Expand Down Expand Up @@ -79,6 +81,7 @@ GEM
mini_portile2 (2.3.0)
minitest (5.11.3)
multi_test (0.1.2)
multipart-post (2.0.0)
mustermann (1.0.2)
mysql2 (0.4.10)
nenv (0.3.0)
Expand Down Expand Up @@ -143,6 +146,8 @@ GEM
ruby-progressbar (1.9.0)
ruby_dep (1.5.0)
safe_yaml (1.0.4)
sentry-raven (2.7.4)
faraday (>= 0.7.6, < 1.0)
sequel (5.5.0)
shellany (0.0.1)
shotgun (0.9.2)
Expand Down Expand Up @@ -211,6 +216,7 @@ DEPENDENCIES
rake
rspec
rubocop
sentry-raven
sequel
shotgun
sinatra
Expand Down
13 changes: 13 additions & 0 deletions config.ru
Expand Up @@ -19,6 +19,19 @@ if ENV['AIRBRAKE_API_KEY'] && ENV['AIRBRAKE_PROJECT_ID']
end
end

if ENV['SENTRY_DSN']
require 'raven'

Raven.configure do |config|
config.dsn = ENV['SENTRY_DSN']
config.current_environment = ENV.fetch('RACK_ENV', 'development')
config.environments = ['production']
config.logger = Bandiera.logger
end

use Raven::Rack
end

if ENV['RACK_CORS_ORIGINS']
require 'rack/cors'

Expand Down

0 comments on commit b2ab229

Please sign in to comment.