module Sqreen::Agent

Public Instance Methods

start() click to toggle source
# 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