-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Martin Fenner
committed
Dec 20, 2019
1 parent
dd0e3b8
commit 419b945
Showing
6 changed files
with
42 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
# Shoryuken middleware to capture worker errors and send them on to Sentry.io | ||
module Shoryuken | ||
module Middleware | ||
module Server | ||
class RavenReporter | ||
def call(worker_instance, queue, sqs_msg, body) | ||
tags = { job: body['job_class'], queue: queue } | ||
context = { message: body } | ||
Raven.capture(tags: tags, extra: context) do | ||
yield | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
Shoryuken.configure_server do |config| | ||
Rails.logger = Shoryuken::Logging.logger | ||
Rails.logger.level = Logger.const_get(ENV["LOG_LEVEL"].upcase) | ||
config.server_middleware do |chain| | ||
# remove logging of timing events | ||
chain.remove Shoryuken::Middleware::Server::Timing | ||
chain.add Shoryuken::Middleware::Server::RavenReporter | ||
end | ||
end | ||
|
||
Shoryuken.active_job_queue_name_prefixing = true |