From a798cc445c83132a3b8665efbde0385c59518bff Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Wed, 8 Oct 2025 14:06:28 -0700 Subject: [PATCH] Prom metrics in dev (#1269) --- .mise.toml | 2 ++ config/puma.rb | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .mise.toml diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 000000000..f0f6aada7 --- /dev/null +++ b/.mise.toml @@ -0,0 +1,2 @@ +[env] +PROMETHEUS_EXPORTER_URL = "http://127.0.0.1:9306/metrics" diff --git a/config/puma.rb b/config/puma.rb index 0c4c0104e..65ff8b776 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -23,9 +23,9 @@ plugin :tmp_restart # Run Solid Queue with Puma plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] -if ENV.fetch("PREFORK") { !Rails.env.local? } - # Expose prometheus metrics on port 9394 - activate_control_app - plugin :yabeda - plugin :yabeda_prometheus -end +# Expose Prometheus metrics at http://0.0.0.0:9394/metrics. +# In dev, overridden to http://127.0.0.1:9306/metrics in .mise.toml. +control_uri = Rails.env.local? ? "unix://tmp/pumactl.sock" : "auto" +activate_control_app control_uri, no_token: true +plugin :yabeda +plugin :yabeda_prometheus