Skip to content

Commit

Permalink
Record metrics on server start
Browse files Browse the repository at this point in the history
This avoids recording metrics when running a Rake task or a console.
  • Loading branch information
thomasleese committed Apr 11, 2022
1 parent 7202977 commit 45c510b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ require 'prometheus/middleware/exporter'
use Prometheus::Middleware::Collector
use Prometheus::Middleware::Exporter

Metrics.instance.record_move_count

run Rails.application
Rails.application.load_server
4 changes: 0 additions & 4 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,5 @@ class Application < Rails::Application
config.generators do |g|
g.orm :active_record, primary_key_type: :uuid
end

config.after_initialize do
Metrics.instance.record_move_count
end
end
end

0 comments on commit 45c510b

Please sign in to comment.