diff options
author | Paweł Chojnacki <pawel@chojnacki.ws> | 2017-08-07 17:13:02 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-08-07 17:13:02 +0000 |
commit | 746f0ec367a82d83b07d8972fd7043cc10baba23 (patch) | |
tree | 2fd525c8ec1c82e60ca2e2100bdc04ebfa16fecf /config | |
parent | b12107a0b953b566cd58db30ae880800a4a695a6 (diff) | |
download | gitlab-ce-746f0ec367a82d83b07d8972fd7043cc10baba23.tar.gz |
Add sidekiq metrics endpoint and add http server to sidekiq
Diffstat (limited to 'config')
-rw-r--r-- | config/gitlab.yml.example | 6 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 4 | ||||
-rw-r--r-- | config/initializers/7_prometheus_metrics.rb | 6 |
3 files changed, 16 insertions, 0 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 45ab4e1a851..e73db08fcac 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -590,6 +590,12 @@ production: &base ip_whitelist: - 127.0.0.0/8 + # Sidekiq exporter is webserver built in to Sidekiq to expose Prometheus metrics + sidekiq_exporter: + # enabled: true + # address: localhost + # port: 3807 + # # 5. Extra customization # ========================== diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 7a43bf939ea..e24cf33adb5 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -524,6 +524,10 @@ Settings.webpack.dev_server['port'] ||= 3808 Settings['monitoring'] ||= Settingslogic.new({}) Settings.monitoring['ip_whitelist'] ||= ['127.0.0.1/8'] Settings.monitoring['unicorn_sampler_interval'] ||= 10 +Settings.monitoring['sidekiq_exporter'] ||= Settingslogic.new({}) +Settings.monitoring.sidekiq_exporter['enabled'] ||= false +Settings.monitoring.sidekiq_exporter['address'] ||= 'localhost' +Settings.monitoring.sidekiq_exporter['port'] ||= 3807 # # Testing settings diff --git a/config/initializers/7_prometheus_metrics.rb b/config/initializers/7_prometheus_metrics.rb index a2f8421f5d7..54c797e0714 100644 --- a/config/initializers/7_prometheus_metrics.rb +++ b/config/initializers/7_prometheus_metrics.rb @@ -10,3 +10,9 @@ Prometheus::Client.configure do |config| config.multiprocess_files_dir ||= Rails.root.join('tmp/prometheus_multiproc_dir') end end + +Sidekiq.configure_server do |config| + config.on(:startup) do + Gitlab::Metrics::SidekiqMetricsExporter.instance.start + end +end |