7_prometheus_metrics.rb 487 Bytes
Newer Older
1 2 3 4 5 6 7 8
require 'prometheus/client'

Prometheus::Client.configure do |config|
  config.logger = Rails.logger

  config.initial_mmap_file_size = 4 * 1024
  config.multiprocess_files_dir = ENV['prometheus_multiproc_dir']

9
  if Rails.env.development? || Rails.env.test?
10 11 12
    config.multiprocess_files_dir ||= Rails.root.join('tmp/prometheus_multiproc_dir')
  end
end
13 14 15 16 17 18

Sidekiq.configure_server do |config|
  config.on(:startup) do
    Gitlab::Metrics::SidekiqMetricsExporter.instance.start
  end
end