summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-01-20 19:00:35 +0000
committerRobert Speicher <rspeicher@gmail.com>2016-01-20 14:01:23 -0500
commit645f7750816d3f92d42221dd2fa38e60d1148b42 (patch)
tree12bb746686e2ae387731bcf4e993f1c891ac4885 /config
parent84316761a6b9d27d0b7a48d72090192d2bbf2a74 (diff)
downloadgitlab-ce-645f7750816d3f92d42221dd2fa38e60d1148b42.tar.gz
Merge branch 'sentry-integration' into 'master'
Add sentry integration Sentry is an event logging platform primarily focused on capturing and aggregating exceptions. With this MR it will be possible to log and track exceptions from GitLab to Sentry. https://gitlab.com/gitlab-com/operations/issues/39 See merge request !2485
Diffstat (limited to 'config')
-rw-r--r--config/initializers/sentry.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb
new file mode 100644
index 00000000000..d0630b9fa07
--- /dev/null
+++ b/config/initializers/sentry.rb
@@ -0,0 +1,19 @@
+# Be sure to restart your server when you modify this file.
+
+require 'gitlab/current_settings'
+include Gitlab::CurrentSettings
+
+if Rails.env.production?
+ # allow it to fail: it may do so when create_from_defaults is executed before migrations are actually done
+ begin
+ sentry_enabled = current_application_settings.sentry_enabled
+ rescue
+ sentry_enabled = false
+ end
+
+ if sentry_enabled
+ Raven.configure do |config|
+ config.dsn = current_application_settings.sentry_dsn
+ end
+ end
+end