diff options
author | Aleksei Lipniagov <alipniagov@gitlab.com> | 2019-07-18 13:54:11 +0000 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2019-07-18 13:54:11 +0000 |
commit | 22e2917b18f9e0544d807a047117b06311f7083b (patch) | |
tree | 7fe8ef692fc9e77797dc8870c954ae3a6a5b951e /config | |
parent | 91903d3a9eb3f72dd0684c983fb200ae14a8eb33 (diff) | |
download | gitlab-ce-22e2917b18f9e0544d807a047117b06311f7083b.tar.gz |
Fix pid providing for Prometheus
Use relative worker identifier for metrics (instead of Process.pid) and
identify when Unicorn/Puma/Sidekiq is used.
Previously, it was assumed that all metrics are gathered from Unicorn
due to hardcoded implementation which was incorrect.
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/7_prometheus_metrics.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/config/initializers/7_prometheus_metrics.rb b/config/initializers/7_prometheus_metrics.rb index 53c3eac3c74..3f2691dde95 100644 --- a/config/initializers/7_prometheus_metrics.rb +++ b/config/initializers/7_prometheus_metrics.rb @@ -1,5 +1,4 @@ require 'prometheus/client' -require 'prometheus/client/support/unicorn' # Keep separate directories for separate processes def prometheus_default_multiproc_dir @@ -23,7 +22,7 @@ Prometheus::Client.configure do |config| config.multiprocess_files_dir = ENV['prometheus_multiproc_dir'] || prometheus_default_multiproc_dir - config.pid_provider = Prometheus::Client::Support::Unicorn.method(:worker_pid_provider) + config.pid_provider = Prometheus::PidProvider.method(:worker_id) end Gitlab::Application.configure do |config| |