Class: HerdstWorker::Adapters::Sentry

Inherits:
Object
  • Object
show all
Defined in:
lib/herdst_worker/adapters/sentry.rb

Class Method Summary collapse

Class Method Details

.setup(app) ⇒ Object



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
# File 'lib/herdst_worker/adapters/sentry.rb', line 10

def self.setup(app)
    begin
        environment = app.config.[:DEPLOYMENT_ENV]
        release = app.config.[:RELEASE_VERSION]
        sentry_key = app.config.[:SENTRY_KEY]
        
        ::Sentry.init do |config|
            config.environment = environment
            config.dsn = sentry_key
            config.enabled_environments = %w[preview production]
            config.release = "#{environment}@#{release}"
            
            # Set traces_sample_rate to 1.0 to capture 100%
            # of transactions for performance monitoring.
            # We recommend adjusting this value in production.
            config.traces_sample_rate = 0.1
            # Set profiles_sample_rate to profile 100%
            # of sampled transactions.
            # We recommend adjusting this value in production.
            config.profiles_sample_rate = 0.1
        end
    rescue Exception => ex
        app.logger.error ex.message
    end
end