2017-07-19 04:54:39 -04:00
|
|
|
require 'prometheus/client'
|
2017-08-29 09:45:19 -04:00
|
|
|
require 'prometheus/client/support/unicorn'
|
2017-07-19 04:54:39 -04:00
|
|
|
|
|
|
|
Prometheus::Client.configure do |config|
|
|
|
|
config.logger = Rails.logger
|
|
|
|
|
|
|
|
config.initial_mmap_file_size = 4 * 1024
|
|
|
|
config.multiprocess_files_dir = ENV['prometheus_multiproc_dir']
|
|
|
|
|
2017-07-25 08:19:09 -04:00
|
|
|
if Rails.env.development? || Rails.env.test?
|
2017-07-19 04:54:39 -04:00
|
|
|
config.multiprocess_files_dir ||= Rails.root.join('tmp/prometheus_multiproc_dir')
|
|
|
|
end
|
2017-08-29 09:45:19 -04:00
|
|
|
|
|
|
|
config.pid_provider = Prometheus::Client::Support::Unicorn.method(:worker_pid_provider)
|
2017-07-19 04:54:39 -04:00
|
|
|
end
|
2017-08-07 13:13:02 -04:00
|
|
|
|
|
|
|
Sidekiq.configure_server do |config|
|
|
|
|
config.on(:startup) do
|
|
|
|
Gitlab::Metrics::SidekiqMetricsExporter.instance.start
|
|
|
|
end
|
|
|
|
end
|