Created
September 8, 2013 17:41
-
-
Save kmayer/6486818 to your computer and use it in GitHub Desktop.
Sidekiq Exception tracer for NewRelic Add this to your sidekiq initializer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment