Commit 7c906a06 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'fix_missing_active_const_error' into 'master'

Fix "A copy of ... has been removed from the module tree but is still active"

See merge request gitlab-org/gitlab!44080
parents 28ab1364 88add409
# Only use Lograge for Rails
unless Gitlab::Runtime.sidekiq?
Rails.application.reloader.to_prepare do
filename = File.join(Rails.root, 'log', "#{Rails.env}_json.log")
db_counter = Gitlab::Metrics::Subscribers::ActiveRecord
Rails.application.configure do
config.lograge.enabled = true
......@@ -15,7 +17,7 @@ unless Gitlab::Runtime.sidekiq?
data[:db_duration_s] = Gitlab::Utils.ms_to_round_sec(data.delete(:db)) if data[:db]
data[:view_duration_s] = Gitlab::Utils.ms_to_round_sec(data.delete(:view)) if data[:view]
data[:duration_s] = Gitlab::Utils.ms_to_round_sec(data.delete(:duration)) if data[:duration]
data.merge!(::Gitlab::Metrics::Subscribers::ActiveRecord.db_counter_payload)
data.merge!(db_counter.db_counter_payload)
# Remove empty hashes to prevent type mismatches
# These are set to empty hashes in Lograge's ActionCable subscriber
......@@ -34,4 +36,5 @@ unless Gitlab::Runtime.sidekiq?
# Add request parameters to log output
config.lograge.custom_options = Gitlab::Lograge::CustomOptions
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment