summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorRoger Meier <r.meier@siemens.com>2019-04-07 21:21:52 +0200
committerRoger Meier <r.meier@siemens.com>2019-04-30 18:10:57 +0200
commitaebb2f70257882dd530b820f3cfdd67621d2a3fd (patch)
treeffc70dec184fbd478ad0898368ec58ad5398ef16 /config
parent2432a540cff461c5d9c0346dd4021229078d674d (diff)
downloadgitlab-ce-aebb2f70257882dd530b820f3cfdd67621d2a3fd.tar.gz
feat: allow Sentry configuration to be passed on gitlab.yml
Diffstat (limited to 'config')
-rw-r--r--config/gitlab.yml.example7
-rw-r--r--config/initializers/1_settings.rb8
-rw-r--r--config/initializers/sentry.rb1
3 files changed, 16 insertions, 0 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index bdac5b2a6a1..06530194907 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -315,6 +315,13 @@ production: &base
# path: shared/registry
# issuer: gitlab-issuer
+
+ ## Error Reporting and Logging with Sentry
+ sentry:
+ # enabled: false
+ # dsn: https://<key>@sentry.io/<project>
+ # environment: 'production' # e.g. development, staging, production
+
#
# 2. GitLab CI settings
# ==========================
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index e9b36873d75..cddf5bf33f5 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -216,6 +216,14 @@ Settings.registry['host_port'] ||= [Settings.registry['host'], Settings.regi
Settings.registry['path'] = Settings.absolute(Settings.registry['path'] || File.join(Settings.shared['path'], 'registry'))
#
+# Error Reporting and Logging with Sentry
+#
+Settings['sentry'] ||= Settingslogic.new({})
+Settings.sentry['enabled'] ||= false
+Settings.sentry['dsn'] ||= nil
+Settings.sentry['environment'] ||= nil
+
+#
# Pages
#
Settings['pages'] ||= Settingslogic.new({})
diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb
index 680cfa6f0ed..e5589ce0ad1 100644
--- a/config/initializers/sentry.rb
+++ b/config/initializers/sentry.rb
@@ -14,6 +14,7 @@ def configure_sentry
Raven.configure do |config|
config.dsn = Gitlab::CurrentSettings.current_application_settings.sentry_dsn
config.release = Gitlab.revision
+ config.current_environment = Gitlab.config.sentry.environment.presence
# Sanitize fields based on those sanitized from Rails.
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)