summaryrefslogtreecommitdiff
path: root/config/initializers/7_prometheus_metrics.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-02-28 20:03:02 +0100
committerKamil Trzciński <ayufan@ayufan.eu>2018-02-28 20:03:02 +0100
commitb1f8d8a1739ff48412c8205f0007a2af8399d097 (patch)
treef7d35d158e7c9bdda6c282f916e02fe9a0d4df90 /config/initializers/7_prometheus_metrics.rb
parent52c3b8f31264230814d2ffa79d0987c1491676b3 (diff)
parent5b08d59f07fc53c1e34819fac20352119d5343e6 (diff)
downloadgitlab-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.rb18
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