Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions app/services/job_runner/lock_referee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ def acquire_lock_and_run_callback_if_needed
log_done_message
end

def log_executing_job_message
Rails.logger.info("#{job_configuration}: Executing job")
end

def log_done_message
Rails.logger.debug("#{job_configuration}: Done")
end

private

def run_needed?
Expand All @@ -40,14 +48,6 @@ def log_race_lost_message
Rails.logger.info(race_lost_message)
end

def log_executing_job_message
Rails.logger.info("#{job_configuration}: Executing job")
end

def log_done_message
Rails.logger.debug("#{job_configuration}: Done")
end

def log_run_not_needed_message(last_run)
Rails.logger.info("#{job_configuration}: Not yet due to run. Last run: #{last_run}")
end
Expand Down
16 changes: 16 additions & 0 deletions config/initializers/new_relic_tracers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'new_relic/agent/method_tracer'
require 'aws/ses'
require 'cloudhsm_jwt'
require 'newrelic_rpm'

Aws::SES::Base.class_eval do
include ::NewRelic::Agent::MethodTracer
Expand Down Expand Up @@ -81,3 +82,18 @@
add_method_tracer :place_call, "Custom/#{name}/place_call"
add_method_tracer :send_sms, "Custom/#{name}/send_sms"
end

JobRunner::LockReferee.class_eval do
include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
add_transaction_tracer :log_executing_job_message, :category => :task
end

JobRunner::LockReferee.class_eval do
include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
add_transaction_tracer :log_done_message, :category => :task
end

UspsConfirmationUploader.class_eval do
include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
add_transaction_tracer :run, :category => :task
end