Commit aa24f7e1 authored by Stan Hu's avatar Stan Hu

Merge branch 'pawel/update-prometheus_gem_to_highly_optimized_version' into 'master'

Update prometheus-client-mmap gem to highly optimized version

See merge request gitlab-org/gitlab-ce!15796
parents 989d3148 ee22a47d
......@@ -486,7 +486,6 @@ GEM
mini_mime (0.1.4)
mini_portile2 (2.3.0)
minitest (5.7.0)
mmap2 (2.2.9)
mousetrap-rails (1.4.6)
multi_json (1.12.2)
multi_xml (0.6.0)
......@@ -623,8 +622,7 @@ GEM
parser
unparser
procto (0.0.3)
prometheus-client-mmap (0.7.0.beta39)
mmap2 (~> 2.2, >= 2.2.9)
prometheus-client-mmap (0.7.0.beta43)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
......
......@@ -20,7 +20,7 @@ class MetricsService
end
def metrics_text
"#{health_metrics_text}#{prometheus_metrics_text}"
prometheus_metrics_text.concat(health_metrics_text)
end
private
......
......@@ -11,14 +11,7 @@ Prometheus::Client.configure do |config|
config.multiprocess_files_dir ||= Rails.root.join('tmp/prometheus_multiproc_dir')
end
config.pid_provider = -> do
worker_id = Prometheus::Client::Support::Unicorn.worker_id
if worker_id.nil?
"process_pid_#{Process.pid}"
else
"worker_id_#{worker_id}"
end
end
config.pid_provider = Prometheus::Client::Support::Unicorn.method(:worker_pid_provider)
end
Gitlab::Application.configure do |config|
......
......@@ -32,7 +32,7 @@ module Gitlab
def init_metrics
metrics = {}
metrics[:sampler_duration] = Metrics.histogram(with_prefix(:sampler_duration, :seconds), 'Sampler time', {})
metrics[:sampler_duration] = Metrics.histogram(with_prefix(:sampler_duration, :seconds), 'Sampler time', { worker: nil })
metrics[:total_time] = Metrics.gauge(with_prefix(:gc, :time_total), 'Total GC time', labels, :livesum)
GC.stat.keys.each do |key|
metrics[key] = Metrics.gauge(with_prefix(:gc, key), to_doc_string(key), labels, :livesum)
......@@ -100,9 +100,9 @@ module Gitlab
worker_no = ::Prometheus::Client::Support::Unicorn.worker_id
if worker_no
{ unicorn: worker_no }
{ worker: worker_no }
else
{ unicorn: 'master' }
{ worker: 'master' }
end
end
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