Start local prometheus_exporter server only in puma/sidekiq startup (#35005)
This commit is contained in:
parent
722fb1ff55
commit
1623d54ec0
4 changed files with 33 additions and 7 deletions
|
@ -21,6 +21,12 @@ if ENV['MASTODON_PROMETHEUS_EXPORTER_ENABLED'] == 'true'
|
|||
require 'prometheus_exporter'
|
||||
require 'prometheus_exporter/instrumentation'
|
||||
|
||||
if ENV['MASTODON_PROMETHEUS_EXPORTER_LOCAL'] == 'true'
|
||||
before_fork do
|
||||
Mastodon::PrometheusExporter::LocalServer.setup!
|
||||
end
|
||||
end
|
||||
|
||||
on_worker_boot do
|
||||
# Ruby process metrics (memory, GC, etc)
|
||||
PrometheusExporter::Instrumentation::Process.start(type: 'puma')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue