mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 12:56:22 +00:00
iniciar prometheus solo en producción
This commit is contained in:
parent
1695cc6771
commit
2383ab9454
2 changed files with 7 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
unless Rails.env.test?
|
||||
if Rails.env.production?
|
||||
require 'prometheus_exporter/middleware'
|
||||
|
||||
# This reports stats per request like HTTP status and timings
|
||||
|
|
|
@ -57,8 +57,10 @@ end
|
|||
on_worker_boot do
|
||||
ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
|
||||
|
||||
require 'prometheus_exporter/instrumentation'
|
||||
PrometheusExporter::Instrumentation::ActiveRecord.start(custom_labels: { type: 'puma_worker' }, config_labels: %i[database host])
|
||||
PrometheusExporter::Instrumentation::Puma.start
|
||||
PrometheusExporter::Instrumentation::Process.start(type: 'web')
|
||||
if Rails.env.production?
|
||||
require 'prometheus_exporter/instrumentation'
|
||||
PrometheusExporter::Instrumentation::ActiveRecord.start(custom_labels: { type: 'puma_worker' }, config_labels: %i[database host])
|
||||
PrometheusExporter::Instrumentation::Puma.start
|
||||
PrometheusExporter::Instrumentation::Process.start(type: 'web')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue