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