Open h0jeZvgoxFepBQ2C opened 3 years ago
I encountered this same issue, and it might have to do with puma running in "single" mode, where we are loading the prometheus_exporter
code before AR has been loaded.
I worked around it by adding PrometheusExporter::Instrumentation::ActiveRecord.start
to my initializer. So my prometheus_exporter
initializer looks like this:
unless Rails.env.test?
require 'prometheus_exporter/middleware'
require 'prometheus_exporter/instrumentation'
Rails.application.middleware.unshift(PrometheusExporter::Middleware)
PrometheusExporter::Instrumentation::ActiveRecord.start
end
I did like it's written in the documentation, but I get following error:
here is my simple puma config: