diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2019-05-29 12:27:44 +0000 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2019-05-29 12:27:44 +0000 |
commit | a5adc6a024012f727ac32c440bb42f4634ae0605 (patch) | |
tree | c02e44b595f6bdc67bc647234dfc4a19972aba6b /config/initializers/7_prometheus_metrics.rb | |
parent | d017d2d93d6afbd597cbf6683fcd7f90e88a05de (diff) | |
download | gitlab-ce-a5adc6a024012f727ac32c440bb42f4634ae0605.tar.gz |
Add Puma sampler
This sampler gathers Puma-specific metrics which can be used by
Prometheus then.
Diffstat (limited to 'config/initializers/7_prometheus_metrics.rb')
-rw-r--r-- | config/initializers/7_prometheus_metrics.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/config/initializers/7_prometheus_metrics.rb b/config/initializers/7_prometheus_metrics.rb index 8052880cc3d..68f8487d377 100644 --- a/config/initializers/7_prometheus_metrics.rb +++ b/config/initializers/7_prometheus_metrics.rb @@ -29,12 +29,18 @@ 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 - unless Sidekiq.server? + 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::Metrics::Samplers::PumaSampler.initialize_instance(Settings.monitoring.puma_sampler_interval).start + end + end end Gitlab::Cluster::LifecycleEvents.on_master_restart do |