summaryrefslogtreecommitdiff
path: root/config.ru
diff options
context:
space:
mode:
authorKevin Lyda <kevin@ie.suberic.net>2017-03-29 19:20:13 +0100
committerPawel Chojnacki <pawel@chojnacki.ws>2017-06-02 19:45:57 +0200
commite4fb16218693edd4382b96482ba94eba6c8a7f1a (patch)
tree5100ada9c38d5f5c1348cfa63bbea9ab786177b3 /config.ru
parentf1cb09913754a9f5d449f01c91de397d7153d3c1 (diff)
downloadgitlab-ce-e4fb16218693edd4382b96482ba94eba6c8a7f1a.tar.gz
Initial pass at prometheus monitoring.
This is a step for #29118. Add a single metric to count successful logins. Summary types are not supported so remove Collector. Either we need to support the summary type or we need to create a multiprocess-friendly Collector. Add config to load prometheus and set up the Collector and the Exporter. Fix `Gemfile` as current prometheus-client gemspec is missing the `mmap2` dependency.
Diffstat (limited to 'config.ru')
-rw-r--r--config.ru7
1 files changed, 7 insertions, 0 deletions
diff --git a/config.ru b/config.ru
index 065ce59932f..82af814341b 100644
--- a/config.ru
+++ b/config.ru
@@ -13,6 +13,13 @@ if defined?(Unicorn)
# Max memory size (RSS) per worker
use Unicorn::WorkerKiller::Oom, min, max
end
+
+ # TODO(lyda): Needs to be set externally.
+ ENV['prometheus_multiproc_dir'] = '/tmp'
+
+ require 'prometheus/client/rack/exporter'
+
+ use Prometheus::Client::Rack::Exporter, path: '/admin/metrics'
end
require ::File.expand_path('../config/environment', __FILE__)