Skip to content

Commit

Permalink
Ensure Sidekiq client middleware is same for clients & servers
Browse files Browse the repository at this point in the history
  • Loading branch information
drcapulet committed Jun 29, 2020
1 parent f5733c8 commit 2b5e400
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/ddtrace/contrib/sidekiq/patcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,21 @@ def target_version

def patch
require 'ddtrace/contrib/sidekiq/client_tracer'
require 'ddtrace/contrib/sidekiq/server_tracer'

::Sidekiq.configure_client do |config|
config.client_middleware do |chain|
chain.add(Sidekiq::ClientTracer)
end
end

require 'ddtrace/contrib/sidekiq/server_tracer'
::Sidekiq.configure_server do |config|
# If a job enqueues another job, make sure it has the same client
# middleware.
config.client_middleware do |chain|
chain.add(Sidekiq::ClientTracer)
end

config.server_middleware do |chain|
chain.add(Sidekiq::ServerTracer)
end
Expand Down

0 comments on commit 2b5e400

Please sign in to comment.