Skip to content

Instantly share code, notes, and snippets.

@kbaum
Last active October 17, 2017 12:54
Show Gist options
  • Save kbaum/32a11876bc26fd70cde4e5f66aad82c7 to your computer and use it in GitHub Desktop.
Save kbaum/32a11876bc26fd70cde4e5f66aad82c7 to your computer and use it in GitHub Desktop.
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