]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: contrib/prometheus-exporter: Restart labels dump at the right pos
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Feb 2021 14:05:21 +0000 (15:05 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Feb 2021 14:21:55 +0000 (15:21 +0100)
commit040b1195f70d6a24204ede081451fd1dd71e6a34
tree71718d905adbb2c95759e9906dcceae44b1dab63
parent32ef48e984deb96ff20b8cb6c98311e41cadb772
BUG/MINOR: contrib/prometheus-exporter: Restart labels dump at the right pos

For some metrics, several lines are produced per entity, one per label
value. For instance, the health-check status (ST_F_CHECK_STATUS) or the
entity status (ST_F_STATUS). The dump may be stopped in the middle of the
labels processing if the output buffer is full. This means the next time, we
must take care to restart on the right label value.

For now, this part is buggy and we always restart to dump all the label
values again from the beginning. To be sure to restart at the right
position, the field <ctx.stats.st_code> in the applet context is used to
save the last position. Of course, we take care to reset this value when
necessary.

This fix is specific for 2.4. No backport needed.
contrib/prometheus-exporter/service-prometheus.c