Commit 8c2bf2c7 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '33125-fix-sidekiq-prometheus' into 'master'

Fix for sidekiq prometheus files being wiped accidentally

Closes #33125

See merge request gitlab-org/gitlab!18568
parents 226e50c8 0db134b7
......@@ -34,6 +34,12 @@ Sidekiq.configure_server do |config|
config.on(:startup) do
# webserver metrics are cleaned up in config.ru: `warmup` block
Prometheus::CleanupMultiprocDirService.new.execute
# 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
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