Last active
October 17, 2017 12:54
-
-
Save kbaum/32a11876bc26fd70cde4e5f66aad82c7 to your computer and use it in GitHub Desktop.
This file contains 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 Middleware | |
module Server | |
class SidekiqNewrelic | |
def call(worker, msg, queue) | |
::NewRelic::Agent.add_custom_attributes({ | |
queue: queue | |
}) | |
yield | |
end | |
end | |
end | |
end | |
Sidekiq.configure_server do |config| | |
config.server_middleware do |chain| | |
chain.add Middleware::Server::SidekiqNewrelic | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment