class NewRelic::Agent::Instrumentation::ActiveJobSubscriber
Constants
- METHOD_NAME_MAPPING
- PATTERN
- PAYLOAD_KEYS
Public Instance Methods
Source
# File lib/new_relic/agent/instrumentation/active_job_subscriber.rb, line 13 def add_segment_params(segment, payload) PAYLOAD_KEYS.each do |key| segment.params[key] = payload[key] if payload.key?(key) end end
Source
# File lib/new_relic/agent/instrumentation/active_job_subscriber.rb, line 39 def method_from_name(name) METHOD_NAME_MAPPING[name] end
Source
# File lib/new_relic/agent/instrumentation/active_job_subscriber.rb, line 21 def metric_name(name, payload) job = payload[:job] || payload[:jobs].first queue = job.queue_name method = method_from_name(name) "Ruby/ActiveJob/#{queue}/#{method}" end
NOTE: For ‘enqueue_all.active_job`, only the first job is used to determine the queue. Therefore, this assumes all jobs given as arguments for perform_all_later share the same queue.