Skip to content

Commit

Permalink
add log to before_first_fork setup and revert to info level
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitch Hartweg committed Dec 12, 2024
1 parent 3d7a90d commit 17c62e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/scout_apm/background_job_integrations/resque.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def install

def install_before_first_fork
::Resque.before_first_fork do
ScoutApm::Agent.instance.context.logger.info "resque_debug Installing Resque before_first_fork"
begin
if ScoutApm::Agent.instance.context.config.value('start_resque_server_instrument')
ScoutApm::Agent.instance.start
Expand Down
10 changes: 5 additions & 5 deletions lib/scout_apm/instruments/resque.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def logger

def before_perform_become_client(*args)
ScoutApm::Agent.instance.context.become_remote_client!(bind, port)
logger.debug "resque_debug REMOTE AGENT"
logger.info "resque_debug REMOTE AGENT"
end

def around_perform_with_scout_instruments(*args)
logger.debug "resque_debug IN AROUND PERFORM"
logger.info "resque_debug IN AROUND PERFORM"
job_name = self.to_s
queue = find_queue

Expand All @@ -32,7 +32,7 @@ def around_perform_with_scout_instruments(*args)
queue = args.first["queue_name"] rescue queue_name
end

logger.debug "resque_debug JOB: #{job_name} QUEUE: #{queue}"
logger.info "resque_debug JOB: #{job_name} QUEUE: #{queue}"

req = ScoutApm::RequestManager.lookup

Expand All @@ -44,14 +44,14 @@ def around_perform_with_scout_instruments(*args)
req.start_layer(ScoutApm::Layer.new('Job', job_name))
started_job = true

logger.debug "resque_debug DOING LAYERS"
logger.info "resque_debug DOING LAYERS"

yield
rescue => e
req.error!
raise
ensure
logger.debug "resque_debug ENSURING"
logger.info "resque_debug ENSURING"
req.stop_layer if started_job
req.stop_layer if started_queue
end
Expand Down

0 comments on commit 17c62e5

Please sign in to comment.