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

@ -1,5 +1,19 @@
# frozen_string_literal: true # frozen_string_literal: true
class ApplicationJob < ActiveJob::Base class ApplicationJob < ActiveJob::Base
# include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
retry_on StandardError, wait: 6.seconds, attempts: 5 unless Docuseal.multitenant? 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 end

@ -1114,4 +1114,4 @@ production:
<<: *default_settings <<: *default_settings
app_name: <%= ENV['NEWRELIC_APP_NAME'] %> Production app_name: <%= ENV['NEWRELIC_APP_NAME'] %> Production
monitor_mode: <%= ENV['NEWRELIC_MONITOR_MODE'].presence || true %> monitor_mode: <%= ENV['NEWRELIC_MONITOR_MODE'].presence || true %>
distributed_tracing.enabled: false distributed_tracing.enabled: false

Loading…
Cancel
Save