Newrelic basic setup + environments

pull/544/head
Mikhael Rakauskas 4 months ago
parent 5e329b5a41
commit c407f2f7ff

@ -10,8 +10,9 @@ class ApplicationController < ActionController::Base
around_action :with_locale
# before_action :sign_in_for_demo, if: -> { Docuseal.demo? }
before_action :maybe_authenticate_via_token
before_action :authenticate_via_token!, unless: :devise_controller?
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,
@ -157,4 +158,11 @@ 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,5 +1,19 @@
# frozen_string_literal: true
class ApplicationJob < ActiveJob::Base
# include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
retry_on StandardError, wait: 6.seconds, attempts: 5 unless Docuseal.multitenant?
# unique :while_executing, on_conflict: :log
# 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