summaryrefslogtreecommitdiff
path: root/config/initializers/7_prometheus_metrics.rb
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-11-23 00:26:50 +0100
committerPawel Chojnacki <pawel@chojnacki.ws>2017-11-23 23:32:55 +0100
commitcdcbeaccbec09fefe81b7b90badacf5308751ce9 (patch)
tree25c866a1052c9b0f7bd606618fd401359e82bed3 /config/initializers/7_prometheus_metrics.rb
parentde2400f6404476e82d95f7cc6cd1fc26779c147b (diff)
downloadgitlab-ce-cdcbeaccbec09fefe81b7b90badacf5308751ce9.tar.gz
Move prometheus middle ware to prometheus initialized.
Diffstat (limited to 'config/initializers/7_prometheus_metrics.rb')
-rw-r--r--config/initializers/7_prometheus_metrics.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/config/initializers/7_prometheus_metrics.rb b/config/initializers/7_prometheus_metrics.rb
index e8f33593fe0..a9138db585f 100644
--- a/config/initializers/7_prometheus_metrics.rb
+++ b/config/initializers/7_prometheus_metrics.rb
@@ -13,7 +13,6 @@ Prometheus::Client.configure do |config|
config.pid_provider = -> do
wid = Prometheus::Client::Support::Unicorn.worker_id
- wid = Process.pid if wid.nil?
if wid.nil?
"process_pid_#{Process.pid}"
else
@@ -22,6 +21,11 @@ Prometheus::Client.configure do |config|
end
end
+Gitlab::Application.configure do |config|
+ # 0 should be Sentry to catch errors in this middleware
+ config.middleware.insert(1, Gitlab::Metrics::RequestsRackMiddleware)
+end
+
Sidekiq.configure_server do |config|
config.on(:startup) do
Gitlab::Metrics::SidekiqMetricsExporter.instance.start