Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Use sentry async again

Oliver Günther354375319baf
diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb
index a2983e6e8bd..373193cc954 100644
--- a/config/initializers/sentry.rb
+++ b/config/initializers/sentry.rb
@@ -24,10 +24,14 @@ if OpenProject::Logging::SentryLogger.enabled?
Sentry.init do |config|
config.dsn = OpenProject::Logging::SentryLogger.sentry_dsn
- config.breadcrumbs_logger = [:active_support_logger]
+ config.breadcrumbs_logger = OpenProject::Configuration.sentry_breadcrumb_loggers.map(&:to_sym)
- # Submit events as delayed job
- config.async = lambda { |event, hint| ::SentryJob.perform_later(event, hint) }
+ # Submit events as delayed job only when requested to do that
+ if ENV['OPENPROJECT_SENTRY_DELAYED_JOB'] == 'true'
+ config.async = lambda do |event, hint|
+ ::SentryJob.perform_later(event, hint)
+ end
+ end
# Don't send loaded modules
config.send_modules = false
diff --git a/lib/open_project/configuration.rb b/lib/open_project/configuration.rb
index 142434f4567..b5558ba771b 100644
--- a/lib/open_project/configuration.rb
+++ b/lib/open_project/configuration.rb
@@ -189,6 +189,8 @@ module OpenProject
# Allow sentry to collect tracing samples on frontend
# set to n >= 1 to enable n times the default tracing
'sentry_frontend_trace_factor' => 0,
+ # Which breadcrumb loggers to enable
+ 'sentry_breadcrumb_loggers' => ['active_support_logger'],
# enable statsd metrics (currently puma only) by configuring host
'statsd' => {