Open pickelsandcarrots316 opened 5 years ago
We currently do not support ipv4 stats sockets. Only unix sockets. We will add this to the roadmap. Also, better error handling would help here also. Where you get the data from the first socket, and ignore the failed one.
Is there a way to make it ignore the ipv4 socket and only use the existing unix socket? I've tried changing the order of the sockets listed, but if any ipv4 socket is listed, it won't operate?
Not currently, I'll fix this before the coming release.
Please checkout latest release (https://github.com/haproxytech/dataplaneapi/releases/tag/v1.2.0) it should be fixed for now before we add support for ipv4 stats sockets.
I tested with the 1.2.0 binary today and it is still failing if you have both a socket and a ip address defined
stats socket /apps/haproxy/bin/admin.sock mode 660 level admin expose-fd listeners
stats socket 127.0.0.1:14567
bin/dataplaneapi -v
HAProxy Data Plane API v1.2.0 5753cad
Build from: git@github.com:haproxytech/dataplaneapi.git
Build date: 2019-08-08T15:53:50
For me this config returns stats from the stats socket and for the second socket returns, only it returns status code 500 in this case, cause the request failed:
{
"error": "dial unix 127.0.0.1:2000: connect: no such file or directory",
"runtimeAPI": "127.0.0.1:2000",
"stats": null
}
When getting a list of sockets I ignore the ones starting with "ipv4@" but maybe I should parse it for IP:port strings and ignore those too.
For reference, this issue above has been solved since October 2019. But unix sockets are still the only type supported.
uname -a
haproxy -vv
dataplaneapi -v
When running the dataplaneapi with the following configuration set in haproxy, dataplaneapi complains about the ipv4 socket existing and won't return data:
haproxy.cfg:
if i GET
http://haproxy.example.com:5555/v1/services/haproxy/stats/native?type=server&parent=internet_443&name=web07
the response is: