Module: Sqreen::Agent

Defined in:
lib/sqreen/agent.rb

Class Method Summary collapse

Class Method Details

.startObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/sqreen/agent.rb', line 26

def start
  return if Sqreen.to_bool(ENV['SQREEN_DISABLE'])

  Sqreen::Dependency::Detector.hook do
    Sqreen.log.debug "[#{Process.pid}] Attaching to webserver"
    Sqreen::WebServer.attach do
      Sqreen.log.debug "[#{Process.pid}] Attached to webserver"
      # TODO: maybe in dependency, not here, to separate concerns?
      Sqreen::Dependency::Sentry.ignore_sqreen_exceptions
      Sqreen::Dependency::NewRelic.ignore_sqreen_exceptions
      Sqreen::Worker.start(Sqreen.framework)
    end
  end
end