Closed xiaosadexiaohai closed 6 years ago
Hi @xiaosadexiaohai;
I would hazard a guess that this exporter requires a webserver to expose the FastCGI status page, as per: https://easyengine.io/tutorials/php/fpm-status-page/
It goes something like:
${EXPORTER} --- (HTTP) ---> Webserver --- (FastCGI) ---> PHP-FPM
That webserver will likely support a unix socket for that FastCGI request.
A webserver is technically not required and I'd prefer to avoid exposing the stats page too.
For an example see Telegraf
@KingCrunch If you're worried about exposing the statistics page to the public, you can bind the statistics vhost to loopback interface, or even a socket.
Additionally, it looks like Telegraf is playing the role of FastCGI proxy here; it does the same thing the webserver will do (but requires an extra binary).
I was surprised myself that this project is not directly connecting to php-fpm but needs a webserver (e.g. nginx) to act as middleware.
Hello,
I created a fork of this repo to connect to the fcgi process. If wanted, I am willing to change stuff to make it work nicely with what is currently provided by https://github.com/bakins/php-fpm-exporter
I'd like to add direct php-fpm interaction. @MattiasGees would you be willing to do a PR for adding that in addition to the existing HTTP support? I can give it a try if you don't have the time.
Update see #16
@bakins Looks good. Fortunately, I have seen it too late which gave me the opportunity to learn some golang :)
Closing this as exporter now supports fastcgi.
Whether to support php-fpm.sock collection.