summaryrefslogtreecommitdiff
path: root/config.ru
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-27 22:40:43 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-27 22:40:43 +0000
commitbbe511b231b5de3fab4dc418601c89cc1ccc8063 (patch)
tree650453c3b64751df39fda6f33ca4b39318f41e0d /config.ru
parentad1c34c03de42ebc5279f338f6304e77930d34d4 (diff)
downloadgitlab-ce-bbe511b231b5de3fab4dc418601c89cc1ccc8063.tar.gz
Add latest changes from gitlab-org/gitlab@14-1-stable-ee
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