Docker image of haproxy:latest seems doesn't like "http-use-htx"


Sorry for my ignorance, but seems I can’t access prometheus metrics endpoint in haproxy:latest official docker image, but it is available in haproxy:lts-alpine official docker image. Any ideas why so?

Basically “http-use-htx” flag do not works in haproxy:latest official docker image.

[NOTICE]   (1) : haproxy version is 2.5.0-f2e0833
[NOTICE]   (1) : path to executable is /usr/local/sbin/haproxy
[ALERT]    (1) : config : parsing [/usr/local/etc/haproxy/haproxy.cfg:14] : unknown option 'http-use-htx'; did you mean 'httpclose' maybe ?
[ALERT]    (1) : config : Error(s) found in configuration file : /usr/local/etc/haproxy/haproxy.cfg
[ALERT]    (1) : config : Fatal errors found in configuration.

http-use-htx is deprecated and ignored since Haproxy 2.1 and has been removed completely in 2.5.

Hi @lukastribus ! Thanks a lot for your response.

So how I can get metrics to prometheus in 2.5 version? In 2.4 I’m using following config:

listen stats
  mode http
  bind *:8404
  option http-use-htx
  http-request use-service prometheus-exporter if { path /metrics }
  stats enable
  stats uri /
  stats refresh 10s


option http-use-htx

Thank you @lukastribus ! It works!!!