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

Add appsignal tags to application job

Oliver Günther10a13e326b12
diff --git a/app/workers/application_job.rb b/app/workers/application_job.rb
index 3721af444fd..677c7e12198 100644
--- a/app/workers/application_job.rb
+++ b/app/workers/application_job.rb
@@ -36,7 +36,7 @@ class ApplicationJob < ::ActiveJob::Base
# to avoid leaking sensitive information to logs
self.log_arguments = false
- around_perform :clean_context
+ around_perform :prepare_job_context
##
# Return a priority number on the given payload
@@ -94,8 +94,9 @@ class ApplicationJob < ::ActiveJob::Base
private
- def clean_context
+ def prepare_job_context
with_clean_request_store do
+ ::OpenProject::Appsignal.tag_request
reload_mailer_settings!
yield
diff --git a/lib_static/open_project/appsignal.rb b/lib_static/open_project/appsignal.rb
index 98aa696d358..45b0ab8c5b4 100644
--- a/lib_static/open_project/appsignal.rb
+++ b/lib_static/open_project/appsignal.rb
@@ -47,7 +47,7 @@ module OpenProject
##
# Add current user and other stateful tags to appsignal
# @param context A hash of context, such as passing in the current controller or request
- def tag_request(context)
+ def tag_request(context = {})
return unless enabled?
payload = tags(context)