summaryrefslogtreecommitdiff
path: root/app/controllers/metrics_controller.rb
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-05-19 18:27:36 +0200
committerPawel Chojnacki <pawel@chojnacki.ws>2017-06-02 19:45:58 +0200
commitc10d55a6dafc6dafe0d3b2d9fad1dc66aee07ff6 (patch)
treef6506a266dd361d7f4d24b0239238e6ad556f9cf /app/controllers/metrics_controller.rb
parent6726922890fa0becd6e0bcd91ca5d2fa79fcccef (diff)
downloadgitlab-ce-c10d55a6dafc6dafe0d3b2d9fad1dc66aee07ff6.tar.gz
Use only ENV for metrics folder location
Diffstat (limited to 'app/controllers/metrics_controller.rb')
-rw-r--r--app/controllers/metrics_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/metrics_controller.rb b/app/controllers/metrics_controller.rb
index f283aeb9db0..18c9625c36a 100644
--- a/app/controllers/metrics_controller.rb
+++ b/app/controllers/metrics_controller.rb
@@ -11,9 +11,9 @@ class MetricsController < ActionController::Base
].freeze
def metrics
- render_404 unless Gitlab::Metrics.prometheus_metrics_enabled?
+ return render_404 unless Gitlab::Metrics.prometheus_metrics_enabled?
- metrics_text = Prometheus::Client::Formats::Text.marshal_multiprocess(Settings.gitlab['prometheus_multiproc_dir'])
+ metrics_text = Prometheus::Client::Formats::Text.marshal_multiprocess(multiprocess_metrics_path)
response = health_metrics_text + "\n" + metrics_text
render text: response, content_type: 'text/plain; version=0.0.4'
@@ -21,6 +21,10 @@ class MetricsController < ActionController::Base
private
+ def multiprocess_metrics_path
+ Rails.root.join(ENV['prometheus_multiproc_dir'])
+ end
+
def health_metrics_text
results = CHECKS.flat_map(&:metrics)