summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-04-09 19:32:22 -0400
committerRobert Speicher <rspeicher@gmail.com>2016-04-09 19:57:27 -0400
commit2378ec0d635a4dbe0d1716a86bb3e3d038518e94 (patch)
tree815da216d2446c9334fd54ab39f50ab58498cc81 /app/controllers
parent593972ca6a551a242b4e1e0e4bb7c25dbc7974ad (diff)
downloadgitlab-ce-2378ec0d635a4dbe0d1716a86bb3e3d038518e94.tar.gz
Add a `program` tag to Sentry Raven contextrs-sidekiq-sentry-context
This will let us filter errors by the program environment in which they were encountered. Source: http://stackoverflow.com/a/28370539/223897 Closes #15092
Diffstat (limited to 'app/controllers')
-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