Skip to content

Commit

Permalink
Add Sidekiq 7.0 middleware modules
Browse files Browse the repository at this point in the history
Sidekiq 7.0 requires middlewares to add new modules. These modules are
not currently in use by our code, but I'm adding them for good measure.
  • Loading branch information
kevinnio committed Jul 6, 2023
1 parent cd330a8 commit 80a0913
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module Client
# TracerMiddleware propagates context and instruments Sidekiq client
# by way of its middleware system
class TracerMiddleware
include ::Sidekiq::ClientMiddleware if defined?(::Sidekiq::ClientMiddleware)

def call(_worker_class, job, _queue, _redis_pool)
attributes = {
SemanticConventions::Trace::MESSAGING_SYSTEM => 'sidekiq',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module Server
# TracerMiddleware propagates context and instruments Sidekiq requests
# by way of its middleware system
class TracerMiddleware
include ::Sidekiq::ServerMiddleware if defined?(::Sidekiq::ServerMiddleware)

def call(_worker, msg, _queue) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
attributes = {
SemanticConventions::Trace::MESSAGING_SYSTEM => 'sidekiq',
Expand Down

0 comments on commit 80a0913

Please sign in to comment.