Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/7_prometheus_metrics.rb')
-rw-r--r--config/initializers/7_prometheus_metrics.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/config/initializers/7_prometheus_metrics.rb b/config/initializers/7_prometheus_metrics.rb
index 92c45c59f7b..772f12d46ed 100644
--- a/config/initializers/7_prometheus_metrics.rb
+++ b/config/initializers/7_prometheus_metrics.rb
@@ -103,6 +103,11 @@ Gitlab::Cluster::LifecycleEvents.on_worker_start do
end
Gitlab::Ci::Parsers.instrument!
+
+ # We intentionally defer this instrumentation to occur after `reinitialize_on_pid_change`.
+ # Otherwise `ConnectionPool.after_fork` will result in the instrumentation being called early,
+ # before we had a chance to re-initialize prometheus mmapped metrics.
+ ConnectionPool.prepend(Gitlab::Instrumentation::ConnectionPool)
rescue IOError => e
Gitlab::ErrorTracking.track_exception(e)
Gitlab::Metrics.error_detected!