Class: Appsignal::Hooks::SidekiqPlugin Private
- Includes:
- Helpers
- Defined in:
- lib/appsignal/hooks/sidekiq.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #call(_worker, item, _queue) ⇒ Object private
- #formatted_metadata(item) ⇒ Object private
- #job_keys ⇒ Object private
Methods included from Helpers
#extract_value, #string_or_inspect, #truncate
Instance Method Details
#call(_worker, item, _queue) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/appsignal/hooks/sidekiq.rb', line 16 def call(_worker, item, _queue) args = if item["class"] == "ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper" item["args"].first["arguments"] else item["args"] end params = Appsignal::Utils::ParamsSanitizer.sanitize args, :filter_parameters => Appsignal.config[:filter_parameters] Appsignal.monitor_transaction( "perform_job.sidekiq", :class => item["wrapped"] || item["class"], :method => "perform", :metadata => (item), :params => params, :queue_start => item["enqueued_at"], :queue_time => (Time.now.to_f - item["enqueued_at"].to_f) * 1000 ) do yield end end |
#formatted_metadata(item) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 42 43 44 45 |
# File 'lib/appsignal/hooks/sidekiq.rb', line 39 def (item) {}.tap do |hsh| item.each do |key, val| hsh[key] = truncate(string_or_inspect(val)) unless job_keys.include?(key) end end end |
#job_keys ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 10 11 12 13 14 |
# File 'lib/appsignal/hooks/sidekiq.rb', line 7 def job_keys @job_keys ||= Set.new(%w( class args retried_at failed_at error_message error_class backtrace error_backtrace enqueued_at retry jid retry created_at wrapped )) end |