diff options
-rw-r--r-- | Gemfile | 4 | ||||
-rw-r--r-- | Gemfile.lock | 2 | ||||
-rw-r--r-- | app/controllers/metrics_controller.rb | 2 | ||||
-rw-r--r-- | spec/controllers/metrics_controller_spec.rb | 9 | ||||
-rw-r--r-- | spec/lib/gitlab/metrics_spec.rb | 1 |
5 files changed, 13 insertions, 5 deletions
@@ -269,9 +269,9 @@ group :metrics do gem 'method_source', '~> 0.8', require: false gem 'influxdb', '~> 0.2', require: false -# Prometheus + # Prometheus gem 'mmap2', '~> 2.2.6' - gem 'prometheus-client-mmap' + gem 'prometheus-client-mmap', '~>0.7.0.beta3' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 0b795f41783..bb574ae1834 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1000,7 +1000,7 @@ DEPENDENCIES pg (~> 0.18.2) poltergeist (~> 1.9.0) premailer-rails (~> 1.9.0) - prometheus-client-mmap + prometheus-client-mmap (~> 0.7.0.beta3) pry-byebug (~> 3.4.1) pry-rails (~> 0.3.4) rack-attack (~> 4.4.1) diff --git a/app/controllers/metrics_controller.rb b/app/controllers/metrics_controller.rb index 18c9625c36a..4c1d04c1262 100644 --- a/app/controllers/metrics_controller.rb +++ b/app/controllers/metrics_controller.rb @@ -7,7 +7,7 @@ class MetricsController < ActionController::Base CHECKS = [ Gitlab::HealthChecks::DbCheck, Gitlab::HealthChecks::RedisCheck, - Gitlab::HealthChecks::FsShardsCheck, + Gitlab::HealthChecks::FsShardsCheck ].freeze def metrics diff --git a/spec/controllers/metrics_controller_spec.rb b/spec/controllers/metrics_controller_spec.rb index d2d4b361a62..7f2dcd3544f 100644 --- a/spec/controllers/metrics_controller_spec.rb +++ b/spec/controllers/metrics_controller_spec.rb @@ -6,8 +6,17 @@ describe MetricsController do let(:token) { current_application_settings.health_check_access_token } let(:json_response) { JSON.parse(response.body) } + around do |examples| + Dir.mktmpdir do |tmp_dir| + @metrics_multiproc_dir = tmp_dir + examples.run + end + end + before do stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') + stub_env('prometheus_multiproc_dir', @metrics_multiproc_dir) + allow(Gitlab::Metrics).to receive(:prometheus_metrics_enabled?).and_return(true) end describe '#metrics' do diff --git a/spec/lib/gitlab/metrics_spec.rb b/spec/lib/gitlab/metrics_spec.rb index 65bd06cda08..020bdbacead 100644 --- a/spec/lib/gitlab/metrics_spec.rb +++ b/spec/lib/gitlab/metrics_spec.rb @@ -243,7 +243,6 @@ describe Gitlab::Metrics do subject { described_class.counter(:counter, 'doc') } it { is_expected.to be_a(Gitlab::Metrics::DummyMetric) } - end describe '#summary' do |