bakins / php-fpm-exporter

Prometheus exporter for php-fpm status.
MIT License
203 stars 46 forks source link

php-fpm.sock #15

Closed xiaosadexiaohai closed 6 years ago

xiaosadexiaohai commented 6 years ago

Whether to support php-fpm.sock collection.

andrewhowdencom commented 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.

kingcrunch commented 6 years ago

A webserver is technically not required and I'd prefer to avoid exposing the stats page too.

For an example see Telegraf

andrewhowdencom commented 6 years ago

@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).

estahn commented 6 years ago

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.

MattiasGees commented 6 years ago

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

bakins commented 6 years ago

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

estahn commented 6 years ago

@bakins Looks good. Fortunately, I have seen it too late which gave me the opportunity to learn some golang :)

https://github.com/hipages/php-fpm_exporter

bakins commented 6 years ago

Closing this as exporter now supports fastcgi.