Move eager load before forking process for Prometheus
This commit is contained in:
@ -12,6 +12,7 @@ module Prometheus
|
||||
def initialize_metrics
|
||||
register_metrics
|
||||
|
||||
Rails.application.eager_load!
|
||||
Thread.new do
|
||||
initialize_instance_count
|
||||
initialize_rfc_metrics
|
||||
@ -33,7 +34,6 @@ module Prometheus
|
||||
end
|
||||
|
||||
def initialize_instance_count
|
||||
Rails.application.eager_load!
|
||||
ApplicationRecord.descendants.reject(&:abstract_class).each do |each|
|
||||
@instance_count.observe(each.count, class: each.name)
|
||||
end
|
||||
|
Reference in New Issue
Block a user