You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.2 KiB

  1. commit 3a00e5fcc1af121dea16793d47627c16c97fb953
  2. Author: Christopher Faulet <cfaulet@haproxy.com>
  3. Date: Wed Nov 27 11:22:37 2019 +0100
  4. BUG/MINOR: contrib/prometheus-exporter: Use HTX errors and not legacy ones
  5. This bug was introduced when the commit 32d634f1 ("MINOR:
  6. contrib/prometheus-exporter: filter exported metrics by scope") was backported
  7. to 2.0.
  8. In 2.0, Error chunks exist in raw format (http_err_chunks[]) and in HTX format
  9. (htx_err_chunks[]). Prometheus exported only supports the HTX. So error must not
  10. be reported using the raw chunks.
  11. This fix is specific to 2.0. No backport needed.
  12. diff --git a/contrib/prometheus-exporter/service-prometheus.c b/contrib/prometheus-exporter/service-prometheus.c
  13. index 56d49a39..cfbfb8c3 100644
  14. --- a/contrib/prometheus-exporter/service-prometheus.c
  15. +++ b/contrib/prometheus-exporter/service-prometheus.c
  16. @@ -2292,7 +2292,7 @@ static int promex_parse_uri(struct appctx *appctx, struct stream_interface *si)
  17. return 1;
  18. error:
  19. - err = &http_err_chunks[HTTP_ERR_400];
  20. + err = &htx_err_chunks[HTTP_ERR_400];
  21. channel_erase(res);
  22. res->buf.data = b_data(err);
  23. memcpy(res->buf.area, b_head(err), b_data(err));