Newrelic and airbrake updates - bare-bones new setups

pull/544/head
Mikhael Rakauskas 4 months ago
parent fa3dad45b2
commit a0bb1638eb

@ -44,7 +44,6 @@ gem 'turbo-rails'
gem 'twitter_cldr', require: false
gem 'tzinfo-data'
gem 'activejob-uniqueness'
gem 'airbrake'
gem 'newrelic_rpm'

@ -47,9 +47,6 @@ GEM
activejob (8.0.1)
activesupport (= 8.0.1)
globalid (>= 0.3.6)
activejob-uniqueness (0.4.0)
activejob (>= 4.2, < 8.1)
redlock (>= 2.0, < 3)
activemodel (8.0.1)
activesupport (= 8.0.1)
activerecord (8.0.1)
@ -446,8 +443,6 @@ GEM
psych (>= 4.0.0)
redis-client (0.23.0)
connection_pool
redlock (2.0.6)
redis-client (>= 0.14.1, < 1.0.0)
regexp_parser (2.9.3)
reline (0.6.0)
io-console (~> 0.5)
@ -599,7 +594,6 @@ PLATFORMS
x86_64-linux-musl
DEPENDENCIES
activejob-uniqueness
airbrake
annotaterb
arabic-letter-connector

@ -12,7 +12,6 @@ class ApplicationController < ActionController::Base
# before_action :sign_in_for_demo, if: -> { Docuseal.demo? }
before_action :maybe_redirect_to_setup, unless: :signed_in?
before_action :authenticate_user!, unless: :devise_controller?
# before_action :newrelic_metadata
helper_method :button_title,
:current_account,
@ -158,11 +157,4 @@ class ApplicationController < ActionController::Base
redirect_to request.url.gsub('.co/', '.com/'), allow_other_host: true, status: :moved_permanently
end
# Add to this as required!
# def newrelic_metadata
# ::NewRelic::Agent.add_custom_attributes(
# user_id: current_user&.id
# )
# end
end

@ -1,21 +1,5 @@
# frozen_string_literal: true
require 'benchmark'
class ApplicationJob < ActiveJob::Base
include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
unique :while_executing, on_conflict: :log
retry_on StandardError, wait: 6.seconds, attempts: 5 unless Docuseal.multitenant?
def perform(*args)
receiver_str, _, message = args.shift.rpartition('.')
time = Benchmark.measure do
receiver_str.constantize.send(message, *args)
end
Rails.logger.info(
"Finished #{receiver_str}.#{message}(#{args.map(&:to_s).join(', ')}): #{time}"
)
end
add_transaction_tracer :perform, category: :task
end

Loading…
Cancel
Save