Use single condition in the prometheus initializer file

This commit is contained in:
Eugene Burmakin 2024-11-20 17:16:26 +01:00
parent 6925e5598b
commit cf5b414ae4

View file

@ -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