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

Upgrade appsignal to 4.2

Oliver Günther8baabfaae96b
diff --git a/Gemfile b/Gemfile
index cbc35414756..4231031b905 100644
--- a/Gemfile
+++ b/Gemfile
@@ -221,7 +221,7 @@ gem "dry-validation"
gem "store_attribute", "~> 1.0"
# Appsignal integration
-gem "appsignal", "~> 3.10.0", require: false
+gem "appsignal", "~> 4.2", require: false
gem "view_component"
# Lookbook
diff --git a/Gemfile.lock b/Gemfile.lock
index 7b504ded5a1..17b017ab3ad 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -343,7 +343,8 @@ GEM
airbrake-ruby (6.2.2)
rbtree3 (~> 0.6)
android_key_attestation (0.3.0)
- appsignal (3.10.0)
+ appsignal (4.2.0)
+ logger
rack
ast (2.4.2)
attr_required (1.0.2)
@@ -1214,7 +1215,7 @@ DEPENDENCIES
acts_as_tree (~> 2.9.0)
addressable (~> 2.8.0)
airbrake (~> 13.0.0)
- appsignal (~> 3.10.0)
+ appsignal (~> 4.2)
auto_strip_attributes (~> 2.5)
awesome_nested_set (~> 3.7.0)
aws-sdk-core (~> 3.107)
diff --git a/config/initializers/appsignal.rb b/config/initializers/appsignal.rb
index 7a7c9fee84e..4159de1e877 100644
--- a/config/initializers/appsignal.rb
+++ b/config/initializers/appsignal.rb
@@ -3,56 +3,53 @@ require_relative "../../lib_static/open_project/appsignal"
if OpenProject::Appsignal.enabled?
require "appsignal"
- Rails.application.configure do |app|
- config = {
- active: true,
- name: ENV.fetch("APPSIGNAL_NAME"),
- push_api_key: ENV.fetch("APPSIGNAL_KEY"),
- revision: OpenProject::VERSION.to_s,
- ignore_actions: [
- "OkComputer::OkComputerController#show",
- "OkComputer::OkComputerController#index",
- "GET::API::V3::Notifications::NotificationsAPI",
- "GET::API::V3::Notifications::NotificationsAPI#/notifications/"
- ],
- ignore_errors: [
- "Grape::Exceptions::MethodNotAllowed",
- "ActionController::UnknownFormat",
- "ActiveJob::DeserializationError",
- "Net::SMTPServerBusy"
- ],
- ignore_logs: [
- "GET /health_check"
- ]
- }
-
- if ENV["APPSIGNAL_DEBUG"] == "true"
- config[:log] = "stdout"
- config[:debug] = true
- config[:log_level] = "debug"
- end
-
- Appsignal.config = Appsignal::Config.new(
- Rails.root,
- Rails.env,
- config
- )
+ Rails.application.configure do |app|
app.middleware.insert_after(
ActionDispatch::DebugExceptions,
Appsignal::Rack::RailsInstrumentation
)
+ end
- # Extend the core log delegator
- handler = OpenProject::Appsignal.method(:exception_handler)
- OpenProject::Logging::LogDelegator.register(:appsignal, handler)
+ Appsignal.configure do |config|
+ config.active = true
+ config.name = ENV.fetch("APPSIGNAL_NAME")
+ config.push_api_key = ENV.fetch("APPSIGNAL_KEY")
+ config.revision = OpenProject::VERSION.to_s
- # Send our logs to appsignal
- if OpenProject::Appsignal.logging_enabled?
- appsignal_logger = Appsignal::Logger.new("rails")
- Rails.logger.broadcast_to(appsignal_logger)
+ if ENV["APPSIGNAL_DEBUG"] == "true"
+ config.log = "stdout"
+ config.log_level = "debug"
end
- Appsignal.start
+ config.ignore_actions = [
+ "OkComputer::OkComputerController#show",
+ "OkComputer::OkComputerController#index",
+ "GET::API::V3::Notifications::NotificationsAPI",
+ "GET::API::V3::Notifications::NotificationsAPI#/notifications/"
+ ]
+
+ config.ignore_errors = [
+ "Grape::Exceptions::MethodNotAllowed",
+ "ActionController::UnknownFormat",
+ "ActiveJob::DeserializationError",
+ "Net::SMTPServerBusy"
+ ]
+
+ config.ignore_logs = [
+ "GET /health_check"
+ ]
end
+
+ # Extend the core log delegator
+ handler = OpenProject::Appsignal.method(:exception_handler)
+ OpenProject::Logging::LogDelegator.register(:appsignal, handler)
+
+ # Send our logs to appsignal
+ if OpenProject::Appsignal.logging_enabled?
+ appsignal_logger = Appsignal::Logger.new("rails")
+ Rails.logger.broadcast_to(appsignal_logger)
+ end
+
+ Appsignal.start
end