Merge branch 'unicorn-sampler-fix' into 'master'
Start UnicornSampler in master process Closes #63830 See merge request gitlab-org/gitlab-ce!30215
This commit is contained in:
commit
c6861b189b
2 changed files with 9 additions and 6 deletions
5
changelogs/unreleased/unicorn-sampler-fix.yml
Normal file
5
changelogs/unreleased/unicorn-sampler-fix.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Make sure UnicornSampler is started only in master process.
|
||||
merge_request: 30215
|
||||
author:
|
||||
type: fixed
|
|
@ -29,15 +29,13 @@ if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled?
|
|||
Gitlab::Cluster::LifecycleEvents.on_worker_start do
|
||||
defined?(::Prometheus::Client.reinitialize_on_pid_change) && Prometheus::Client.reinitialize_on_pid_change
|
||||
|
||||
if defined?(::Unicorn)
|
||||
Gitlab::Metrics::Samplers::UnicornSampler.initialize_instance(Settings.monitoring.unicorn_sampler_interval).start
|
||||
end
|
||||
|
||||
Gitlab::Metrics::Samplers::RubySampler.initialize_instance(Settings.monitoring.ruby_sampler_interval).start
|
||||
end
|
||||
|
||||
if defined?(::Puma)
|
||||
Gitlab::Cluster::LifecycleEvents.on_master_start do
|
||||
Gitlab::Cluster::LifecycleEvents.on_master_start do
|
||||
if defined?(::Unicorn)
|
||||
Gitlab::Metrics::Samplers::UnicornSampler.initialize_instance(Settings.monitoring.unicorn_sampler_interval).start
|
||||
elsif defined?(::Puma)
|
||||
Gitlab::Metrics::Samplers::PumaSampler.initialize_instance(Settings.monitoring.puma_sampler_interval).start
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue