-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metricbeat compatibility with HAProxy 1.5 and 1.7 #5211
Comments
I am unable to get the HAProxy to work with 1.7 (via marathon-lb docker). for marathon-lb, I provide a head template snippet to make sure tcp stats are enabled:
And I configure the modules.d/haproxy
The result is haproxy adds errors to the metricbeat index, with errors stating:
and
Debug mode gives little more information in metricbeat console output. I started to compare csv formats between 1.6 and 1.7, and it looks like it only adds additional fields. But the docs for tcp socket communicate have changed as well. Not a go programmer, but it looks like some work was done to anticipate extra ",". But by the logs it looks like it does not get any csv back. I tried metricbeat 5.6.4 and 5.6.3. The haproxy tcp connection might not be compatible version to version. Why not use csv with http api at /haproxy?stats;csv for stats and /_haproxy_getconfig for info? |
@joelstewart Thanks for the detailed investigation. I'm not an expert on HAProxy and din't know we could also get the metrics though http. Perhaps @hartfordfive can share some more thoughts here? Could you share the links to docs you found about the socket changes and the http endpoints? I struggle a bit to find the right pages, probably I just use the wrong Google queries :-( |
links to 1.6 and 1.7 docs. shows new section for "tcp commands (section 9.2 is new)" https://cbonte.github.io/haproxy-dconv/1.6/management.html#9 Note also section 9.1 has the list of CSV, and I believe that it should be backward compatible as it only appends new fields to the format. When enabling http mode on "listen stats" port, there are configs to mirror in HAProxy.yml module... https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#4.2-stats%20enable Upon further investigation, It appears that the _haproxy_getconfig method is NOT HAProxy, this was added by marathon-lb (the wrapper I am using) https://github.com/mesosphere/marathon-lb/blob/master/getconfig.lua . So HAProxy "info" may not be available this route. However, many of the fields that are separated into "info" module (https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-metricset-haproxy-info.html) appear in the stats as well: pxname,svname,qcur,qmax,scur,smax,slim,stot,bin,bout,dreq,dresp,ereq,econ,eresp,wretr,wredis,status,weight,act,bck,chkfail,chkdown,lastchg,downtime,qlimit,pid,iid,sid,throttle,lbtot,tracked,type,rate,rate_lim,rate_max,check_status,check_code,check_duration,hrsp_1xx,hrsp_2xx,hrsp_3xx,hrsp_4xx,hrsp_5xx,hrsp_other,hanafail,req_rate,req_rate_max,req_tot,cli_abrt,srv_abrt,comp_in,comp_out,comp_byp,comp_rsp,lastsess,last_chk,last_agt,qtime,ctime,rtime,ttime,agent_status,agent_code,agent_duration,check_desc,agent_desc,check_rise,check_fall,check_health,agent_rise,agent_fall,agent_health,addr,cookie,mode,algo,conn_rate,conn_rate_max,conn_tot,intercepted,dcon,dses, ty |
@joelstewart Thanks a lot for all the links and notes. This is super helpful. I need to have a deeper look at all this when I find the time to figure out what our future approach here should be. |
@jsoriano Let's close this issue as the PR solve on what the issue was opened for but lets open a new one to track the testing of both versions (or directly a PR ;-) ). |
1.6 is supported today and a one-off test showed that 1.5 and 1.7 might work as well. They need to be tested automatically to make them supported.
(Related: #5210)
The text was updated successfully, but these errors were encountered: