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.ru')
-rw-r--r--config.ru6
1 files changed, 6 insertions, 0 deletions
diff --git a/config.ru b/config.ru
index ed76239ef2e..ebe719d4b0f 100644
--- a/config.ru
+++ b/config.ru
@@ -9,6 +9,12 @@ def master_process?
end
warmup do |app|
+ # The following is necessary to ensure stale Prometheus metrics don't accumulate over time.
+ # It needs to be done as early as here to ensure metrics files aren't deleted.
+ # After we hit our app in `warmup`, first metrics and corresponding files already being created,
+ # for example in `lib/gitlab/metrics/requests_rack_middleware.rb`.
+ Prometheus::CleanupMultiprocDirService.new.execute if master_process?
+
client = Rack::MockRequest.new(app)
client.get('/')
end