From cf5b414ae46d1b3f324518049cda2c666c63a895 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Wed, 20 Nov 2024 17:16:26 +0100 Subject: [PATCH] Use single condition in the prometheus initializer file --- config/initializers/prometheus.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/config/initializers/prometheus.rb b/config/initializers/prometheus.rb index 9d25d4ea..a8ffc08d 100644 --- a/config/initializers/prometheus.rb +++ b/config/initializers/prometheus.rb @@ -1,15 +1,12 @@ # in config/initializers/prometheus.rb if Rails.env != "test" require 'prometheus_exporter/middleware' + require 'prometheus_exporter/instrumentation' # This reports stats per request like HTTP status and timings Rails.application.middleware.unshift PrometheusExporter::Middleware -end -if Rails.env != "test" - require 'prometheus_exporter/instrumentation' - - # this reports basic process stats like RSS and GC info, type master + # this reports basic process stats like RSS and GC info, type master # means it is instrumenting the master process PrometheusExporter::Instrumentation::Process.start(type: "master") end