Sidekiq + Newrelic Exception Notifier
require 'sidekiq'
module NewRelic
class SidekiqException
def call(worker, msg, queue)
begin
yield
rescue => exception
NewRelic::Agent.notice_error(exception, :custom_params => msg)
raise exception
end
end
end
end
::Sidekiq.configure_server do |config|
config.server_middleware do |chain|
chain.add ::NewRelic::SidekiqException
end
end
Written by Seyhun AKYÜREK
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#