Commit bc95a38c authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '37387-do-not-clean-sidekiq-metrics' into 'master'

Do not clean the prometheus metrics directory for sidekiq

See merge request gitlab-org/gitlab!21671
parents dc144187 38f8aedd
---
title: Do not clean the prometheus metrics directory for sidekiq
merge_request: 21671
author:
type: fixed
...@@ -32,15 +32,8 @@ end ...@@ -32,15 +32,8 @@ end
Sidekiq.configure_server do |config| Sidekiq.configure_server do |config|
config.on(:startup) do config.on(:startup) do
# webserver metrics are cleaned up in config.ru: `warmup` block # Do not clean the metrics directory here - the supervisor script should
Prometheus::CleanupMultiprocDirService.new.execute # have already taken care of that
# In production, sidekiq is run in a multi-process setup where processes might interfere
# with each other cleaning up and reinitializing prometheus database files, which is why
# we're re-doing the work every time here.
# A cleaner solution would be to run the cleanup pre-fork, and the initialization once
# after all workers have forked, but I don't know how at this point.
::Prometheus::Client.reinitialize_on_pid_change(force: true)
Gitlab::Metrics::Exporter::SidekiqExporter.instance.start Gitlab::Metrics::Exporter::SidekiqExporter.instance.start
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment