Move Prometheus initialization after preloading the remaining app

This commit is contained in:
Sebastian Serth
2021-04-22 12:34:27 +02:00
parent 567a75d9ae
commit 6a6e1c84f4
3 changed files with 6 additions and 3 deletions

View File

@ -34,5 +34,10 @@ module CodeOcean
config.action_cable.mount_path = '/cable'
config.telegraf.tags = { application: 'codeocean' }
config.after_initialize do
# Initialize the counters according to the db
Prometheus::Controller.initialize_metrics
end
end
end

View File

@ -6,5 +6,4 @@ return if %w[db: assets:].any? { |task| Rake.application.top_level_tasks.to_s.in
# Add metric callbacks to all models
ApplicationRecord.include Prometheus::Record
# Initialize the counters according to the db
Prometheus::Controller.initialize_metrics
# Initialization is performed in config/application.rb