Skip to content

Commit

Permalink
Merge pull request #4 from instrumentl/feat_sidekiq
Browse files Browse the repository at this point in the history
feat(sidekiq): add a Sidekiq Server middleware for sampling
  • Loading branch information
gsinkin-instrumentl authored Dec 9, 2022
2 parents 674dc11 + c3e49e2 commit 37571de
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions lib/scout_apm/sampling/sidekiq/server_middleware.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module ScoutApm
module Sampling
module Sidekiq
include Callbacks

class ServerMiddleware
# @param [Object] worker the worker instance
# @param [Hash] job the full job payload
# * @see https://github.com/mperham/sidekiq/wiki/Job-Format
# @param [String] queue the name of the queue the job was pulled from
# @yield the next middleware in the chain or worker `perform` method
# @return [Void]
def call(worker, job, queue)
sample_workers_for_scout
yield
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/scout_apm/sampling/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ScoutApm
module Sampling
VERSION = "3.0.0".freeze
VERSION = "3.0.1".freeze
end
end

0 comments on commit 37571de

Please sign in to comment.