yabeda-puma-plugin
yabeda-puma-plugin copied to clipboard
Got empty response from metrics endpoint when starting server via bundle exec puma.
Overview
Hello.
I use this gem integrating with rails. However,
- When I run rails app via
bundle exec puma -C config/puma.rb
, I get empty response from metrics endpoint. - On the other hand, when via
bundle exec rails s
, I get valid response from metrics endpoint.
This may be caused by the similar problem:
https://github.com/yabeda-rb/yabeda/issues/15
Reproduce
I reproduced this problem in puma single worker mode, and exposing metrics on different port from puma.
- ruby: 3.0.2
- rails: 6.1.4.1
- gems:
- yabeda-puma-plugin: 0.6.0
- yabeda-prometheus: 0.7.0
- yabeda: 0.11.0
- prometheus-client: 2.1.0
- config/puma.rb:
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
threads min_threads_count, max_threads_count
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
port ENV.fetch("PORT") { 3000 }
environment ENV.fetch("RAILS_ENV") { "development" }
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
plugin :tmp_restart
activate_control_app
plugin :yabeda
plugin :yabeda_prometheus
I also ran into this problem yesterday when setting up Yabeda w/the Puma and Prometheus plugins.