Closed pohodnya closed 4 years ago
Thanks for reporting!
It seems weird from the first view, but it looks like that we are starting our built-in Prometheus exporter too early: before Puma process double-forks itself in order to daemonize. So we launching it in a “launcher” process which is being immediately shut down and in forked process Puma execution continues but our bind to tcp port is already lost.
So I propose a fix which effectively postpones exporter launch on after daemonization process, please try it right from #14.
To do so place following line into your Gemfile:
gem "yabeda-puma-plugin", git: "https://github.com/yabeda-rb/yabeda-puma-plugin", branch: "fix/support-daemon-mode" # https://github.com/yabeda-rb/yabeda-puma-plugin/pull/14
Also please note that daemonization was removed from Puma 5.x as today process self-daemonization is considered to be a bad practice and usage of process monitoring tools is recommended instead (systemd, etc). Read more at https://github.com/puma/puma/blob/5-0-stable/docs/deployment.md#should-i-daemonize
Thanks! It's working!
When I run puma with command
Then it's OK
But When I run Puma with option --daemon
then
/metrics
not responded