summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-04-10 00:29:33 +0000
committerStan Hu <stanhu@gmail.com>2016-04-10 00:29:33 +0000
commitdfe4c69ea8f7f60b43b3ab608088d289dae075d9 (patch)
tree587e5d4b343802fc98310f7138e6e3cb0824dfb6
parenta2303417d02e2ec5b335dff6ae1e76200c811ca9 (diff)
parent2378ec0d635a4dbe0d1716a86bb3e3d038518e94 (diff)
downloadgitlab-ce-dfe4c69ea8f7f60b43b3ab608088d289dae075d9.tar.gz
Merge branch 'rs-sidekiq-sentry-context' into 'master'
Add a `sidekiq` tag to Sentry Raven context This will let us filter errors that were/were not in the Sidekiq environment. Source: http://stackoverflow.com/a/28370539/223897 Closes #15092 See merge request !3634
-rw-r--r--app/controllers/application_controller.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index c81cb85dc1b..97d53acde94 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -47,6 +47,16 @@ class ApplicationController < ActionController::Base
email: current_user.email,
username: current_user.username,
)
+
+ Raven.tags_context(program: sentry_program_context)
+ end
+ end
+
+ def sentry_program_context
+ if Sidekiq.server?
+ 'sidekiq'
+ else
+ 'rails'
end
end