Le 05/12/2019 à 13:54, Julien Pivotto a écrit :
Dear list,

I am looking at the Prometheus metrics in HAProxy and I miss some of
them:

- Is it possible to get a more fine grained view of the return codes
   than 2xx,3xx,4xx. Indeed, an error 404 is different than 403
   (404 might be the browser trying to get a favicon and 400 an actual
   error) and 503 is different than 500 (500 might be a business SOAP
   FAULT)


There is no such metrics exported because these counters are not available in HAProxy. So it is not limited to the Prometheus exporter. Have a counter for each HTTP codes is overkill. Have specific counters for some special HTTP codes, depending on their importance, is possible. But we will always have a guy to say some codes are missing. A better solution would be to have a way to "register" new counters, using the cli or something else. Another solution could also be to have some "modules" to provide more metrics. I guess it is better to have extendable stats than to always extend them.


- I see no metrics like:
     - haproxy_frontend_http_responses_seconds_total
     - haproxy_backend_http_responses_seconds_total
   Those metrics would allow me to calculate the response time of the
   http queries that go via HAProxy.


If you want to use such metrics to get the average response time, you can use the average response time for last 1024 successful connections, per backend and per server :
  - haproxy_backend_response_time_average_seconds
  - haproxy_server_response_time_average_seconds

--
Christopher Faulet

Reply via email to