Skip to content

Commit

Permalink
Revert "Upgrade appsignal to 4.2"
Browse files Browse the repository at this point in the history
This reverts commit 8baabfa.
  • Loading branch information
machisuji committed Nov 25, 2024
1 parent 9059ba6 commit 74c2571
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ gem "dry-validation"
gem "store_attribute", "~> 1.0"

# Appsignal integration
gem "appsignal", "~> 4.2", require: false
gem "appsignal", "~> 3.10.0", require: false

gem "view_component"
# Lookbook
Expand Down
5 changes: 2 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,7 @@ GEM
airbrake-ruby (6.2.2)
rbtree3 (~> 0.6)
android_key_attestation (0.3.0)
appsignal (4.2.0)
logger
appsignal (3.10.0)
rack
ast (2.4.2)
attr_required (1.0.2)
Expand Down Expand Up @@ -1209,7 +1208,7 @@ DEPENDENCIES
acts_as_tree (~> 2.9.0)
addressable (~> 2.8.0)
airbrake (~> 13.0.0)
appsignal (~> 4.2)
appsignal (~> 3.10.0)
auto_strip_attributes (~> 2.5)
awesome_nested_set (~> 3.7.0)
aws-sdk-core (~> 3.107)
Expand Down
81 changes: 42 additions & 39 deletions config/initializers/appsignal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,56 @@

if OpenProject::Appsignal.enabled?
require "appsignal"

Rails.application.configure do |app|
app.middleware.insert_after(
ActionDispatch::DebugExceptions,
Appsignal::Rack::RailsInstrumentation
)
end

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
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.log_level = "debug"
config[:log] = "stdout"
config[:debug] = true
config[:log_level] = "debug"
end

config.ignore_actions = [
"OkComputer::OkComputerController#show",
"OkComputer::OkComputerController#index",
"GET::API::V3::Notifications::NotificationsAPI",
"GET::API::V3::Notifications::NotificationsAPI#/notifications/"
]
Appsignal.config = Appsignal::Config.new(
Rails.root,
Rails.env,
config
)

config.ignore_errors = [
"Grape::Exceptions::MethodNotAllowed",
"ActionController::UnknownFormat",
"ActiveJob::DeserializationError",
"Net::SMTPServerBusy"
]
app.middleware.insert_after(
ActionDispatch::DebugExceptions,
Appsignal::Rack::RailsInstrumentation
)

config.ignore_logs = [
"GET /health_check"
]
end
# Extend the core log delegator
handler = OpenProject::Appsignal.method(:exception_handler)
OpenProject::Logging::LogDelegator.register(:appsignal, handler)

# 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

# Send our logs to appsignal
if OpenProject::Appsignal.logging_enabled?
appsignal_logger = Appsignal::Logger.new("rails")
Rails.logger.broadcast_to(appsignal_logger)
Appsignal.start
end

Appsignal.start
end

0 comments on commit 74c2571

Please sign in to comment.