-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.ru
35 lines (29 loc) · 948 Bytes
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require "active_support"
require "active_support/cache"
require "active_support/notifications"
require "sentry-ruby"
require "zeitwerk"
loader = Zeitwerk::Loader.new
loader.push_dir("#{__dir__}/lib/")
loader.inflector.inflect "oauth_token_controller" => "OAuthTokenController"
loader.inflector.inflect "oauth_token_test_controller" => "OAuthTokenTestController"
loader.setup
environment = ENV["STAGE"]
unless %w[development test].include?(environment)
Sentry.init do |config|
config.environment = environment
config.before_send = lambda do |event, hint|
if hint[:exception].is_a?(Boundary::Error)
nil
else
event
end
end
config.traces_sampler = lambda do |sampling_context|
# if this is the continuation of a trace, just use that decision (rate controlled by the caller)
!!sampling_context[:parent_sampled]
end
end
use Sentry::Rack::CaptureExceptions
end
run Service.new