bakins / php-fpm-exporter

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

fastcgi dial failed: dial: unknown network #20

Closed w0rd-driven closed 5 years ago

w0rd-driven commented 6 years ago

I opted to expose /status and /ping per the link to easyengine but it looks like no matter what I do, it still tries to connect to fastcgi.

I'm using the released version from https://github.com/bakins/php-fpm-exporter/releases/download/v0.4.1/php-fpm-exporter.linux.amd64. I'm not terribly familiar with Go but it looks like the culprit is https://github.com/bakins/php-fpm-exporter/blob/master/collector.go#L147. I'm using the options --addr 127.0.0.1:9914 --endpoint http://localhost/status. My gut tells me perhaps https://github.com/bakins/php-fpm-exporter/blob/master/cmd/php-fpm-exporter/main.go#L15 is the culprit if go is like other languages where an empty string pointer or string isn't nil.

I'm likely wrong on the specifics but I feel like if I could somehow get line 147 to call getDataHTTP instead of getDataFastcgi I'd get the results I'm expecting. I can verify the php-fpm status page is working with the endpoint provided so that shouldn't be the problem unless I've specified something incorrectly.

bakins commented 6 years ago

Thanks for the bug report. I'm still using an older version for my production deployments. I'll take a look at this and also figure out a better way to test so I don't break others in the future. Sorry about that!

jangrewe commented 5 years ago

Can we get an updated Docker image for this, please? :-)