Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions config/initializers/_shoryuken.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,19 @@
module Shoryuken
module Middleware
module Server
class RavenReporter
def call(_worker_instance, queue, _sqs_msg, body, &block)
tags = { job: body["job_class"], queue: queue }
context = { message: body }
Raven.capture(tags: tags, extra: context, &block)
class SentryReporter
def call(worker_instance, queue, sqs_msg, body)
Sentry.with_scope do |scope|
scope.set_tags(job: body['job_class'], queue: queue)
scope.set_extras(message: body)

begin
yield
rescue => e
Sentry.capture_exception(e)
raise e
end
end
end
end
end
Expand All @@ -27,7 +35,7 @@ def call(_worker_instance, queue, _sqs_msg, body, &block)
config.server_middleware do |chain|
# remove logging of timing events
chain.remove Shoryuken::Middleware::Server::Timing
chain.add Shoryuken::Middleware::Server::RavenReporter
chain.add Shoryuken::Middleware::Server::SentryReporter
end
end

Expand Down
Loading