summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-04-30 18:27:27 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-04-30 18:27:27 +0000
commit29c5174274feafebc4ecb182eaece3dfb2197d22 (patch)
treee1632a18a93076b6cad8f92b1258579ff6e93e8f /config
parent93a332a620f54038d78bd82ce6f1f553d92b7f46 (diff)
parentaebb2f70257882dd530b820f3cfdd67621d2a3fd (diff)
downloadgitlab-ce-29c5174274feafebc4ecb182eaece3dfb2197d22.tar.gz
Merge branch 'feat/sentry-environment' into 'master'
feat: add option to define the Sentry Environment See merge request gitlab-org/gitlab-ce!27091
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 18c3686e6b4..154de3bc1b0 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -218,6 +218,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)