-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfig.ru
More file actions
40 lines (32 loc) · 1010 Bytes
/
config.ru
File metadata and controls
40 lines (32 loc) · 1010 Bytes
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
36
37
38
39
40
require "active_support"
require "active_support/core_ext"
require "sentry-ruby"
require "sinatra/activerecord"
require "zeitwerk"
loader = Zeitwerk::Loader.new
loader.push_dir("#{__dir__}/lib/")
loader.setup
environment = ENV["STAGE"]
ActiveRecord::Base.connects_to(database: { writing: :primary, reading: :primary_replica })
Sentry.init do |config|
config.environment = environment
config.include_local_variables = true
config.before_send = lambda do |event, hint|
if hint[:exception].is_a?(Controller::BaseController::ScheduledDowntimeError)
nil
else
event
end
end
config.send_default_pii = true
config.traces_sampler = lambda do |sampling_context|
# if this is the continuation of a trace, just use that decision (rate controlled by the caller)
unless sampling_context[:parent_sampled].nil?
next sampling_context[:parent_sampled]
end
0.0004
end
end
use Sentry::Rack::CaptureExceptions
use Middleware::HeadersPolicy
run RegisterApiService