From 9c601cf6433be0eb16cfb1c7e39e9f7dc2955df9 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 22 Aug 2017 13:40:19 +0200 Subject: [PATCH] Add prometheus client reset to unicorn.rb - https://gitlab.com/gitlab-org/gitlab-ce/blob/9-5-stable/config/unicorn.rb.example#L124 --- assets/runtime/config/gitlabhq/unicorn.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/runtime/config/gitlabhq/unicorn.rb b/assets/runtime/config/gitlabhq/unicorn.rb index ee8c0cf9..3d62d74d 100644 --- a/assets/runtime/config/gitlabhq/unicorn.rb +++ b/assets/runtime/config/gitlabhq/unicorn.rb @@ -120,6 +120,10 @@ after_fork do |server, worker| # the following is *required* for Rails + "preload_app true", defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection + + # reset prometheus client, this will cause any opened metrics files to be closed + defined?(::Prometheus::Client.reinitialize_on_pid_change) && + Prometheus::Client.reinitialize_on_pid_change # if preload_app is true, then you may also want to check and # restart any other shared sockets/descriptors such as Memcached,