diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 20:03:02 +0100 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 20:03:02 +0100 |
commit | b1f8d8a1739ff48412c8205f0007a2af8399d097 (patch) | |
tree | f7d35d158e7c9bdda6c282f916e02fe9a0d4df90 /config/initializers/7_prometheus_metrics.rb | |
parent | 52c3b8f31264230814d2ffa79d0987c1491676b3 (diff) | |
parent | 5b08d59f07fc53c1e34819fac20352119d5343e6 (diff) | |
download | gitlab-ce-b1f8d8a1739ff48412c8205f0007a2af8399d097.tar.gz |
Merge commit '5b08d59f07fc53c1e34819fac20352119d5343e6' into object-storage-ee-to-ce-backport
Diffstat (limited to 'config/initializers/7_prometheus_metrics.rb')
-rw-r--r-- | config/initializers/7_prometheus_metrics.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/config/initializers/7_prometheus_metrics.rb b/config/initializers/7_prometheus_metrics.rb new file mode 100644 index 00000000000..54c797e0714 --- /dev/null +++ b/config/initializers/7_prometheus_metrics.rb @@ -0,0 +1,18 @@ +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'] + + if Rails.env.development? || Rails.env.test? + config.multiprocess_files_dir ||= Rails.root.join('tmp/prometheus_multiproc_dir') + end +end + +Sidekiq.configure_server do |config| + config.on(:startup) do + Gitlab::Metrics::SidekiqMetricsExporter.instance.start + end +end |