From f908d975adbe78f00b7ce858674bded26d493ce4 Mon Sep 17 00:00:00 2001 From: Toby Retallick Date: Wed, 9 Jan 2019 14:13:39 +0000 Subject: [PATCH] Add metrics initializer --- config/initializers/metrics.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 config/initializers/metrics.rb diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb new file mode 100644 index 0000000..0bbab78 --- /dev/null +++ b/config/initializers/metrics.rb @@ -0,0 +1,7 @@ +unless Rails.env.test? + require 'prometheus_exporter/instrumentation' + require 'prometheus_exporter/middleware' + + PrometheusExporter::Instrumentation::Process.start(type: 'master') + Rails.application.middleware.unshift PrometheusExporter::Middleware +end