parent
42da22b9f1
commit
78cc8b30d4
@ -0,0 +1,33 @@ |
||||
require 'open_project/version' |
||||
|
||||
if ENV['APPSIGNAL_ENABLED'] == 'true' |
||||
require 'appsignal' |
||||
OpenProject::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: %w[OkComputerController#index OkComputerController#show] |
||||
} |
||||
|
||||
if Rails.env.development? |
||||
config[:log] = 'stdout' |
||||
config[:debug] = true |
||||
config[:log_level] = 'debug' |
||||
end |
||||
|
||||
Appsignal.config = Appsignal::Config.new( |
||||
Rails.root, |
||||
Rails.env, |
||||
config |
||||
) |
||||
|
||||
app.middleware.insert_after( |
||||
ActionDispatch::DebugExceptions, |
||||
Appsignal::Rack::RailsInstrumentation |
||||
) |
||||
|
||||
Appsignal.start |
||||
end |
||||
end |
@ -0,0 +1,41 @@ |
||||
#-- copyright |
||||
# OpenProject is an open source project management software. |
||||
# Copyright (C) 2012-2022 the OpenProject GmbH |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See COPYRIGHT and LICENSE files for more details. |
||||
#++ |
||||
require "appsignal" |
||||
require "appsignal/integrations/grape" |
||||
|
||||
module API |
||||
module AppsignalAPI |
||||
def self.included(base) |
||||
base.class_eval do |
||||
if Appsignal.active? |
||||
insert_before Grape::Middleware::Error, Appsignal::Grape::Middleware |
||||
end |
||||
end |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue