2024-11-20 06:02:31 -05:00
|
|
|
# in config/initializers/prometheus.rb
|
|
|
|
|
if Rails.env != "test"
|
|
|
|
|
require 'prometheus_exporter/middleware'
|
2024-11-20 11:16:26 -05:00
|
|
|
require 'prometheus_exporter/instrumentation'
|
2024-11-20 06:02:31 -05:00
|
|
|
|
|
|
|
|
# This reports stats per request like HTTP status and timings
|
|
|
|
|
Rails.application.middleware.unshift PrometheusExporter::Middleware
|
|
|
|
|
|
2024-11-20 11:16:26 -05:00
|
|
|
# this reports basic process stats like RSS and GC info, type master
|
2024-11-20 06:02:31 -05:00
|
|
|
# means it is instrumenting the master process
|
|
|
|
|
PrometheusExporter::Instrumentation::Process.start(type: "master")
|
|
|
|
|
end
|