MINOR: contrib/prometheus-exporter: export build_info
commit c55a626217a7e676e1cc ("MINOR: contrib/prometheus-exporter: Add
missing global and per-server metrics") is renaming two metrics between
v2.2 and v2.3:
server_idle_connections_current
server_idle_connections_limit
It is breaking some tools which are making use of those metrics while
supporting several haproxy versions. This build_info will permit tools
which make use of metrics to be able to match the haproxy version and
change the list of expected metrics. This was possible using the haproxy
stats socket but not with prometheus export.
This patch follows prometheus best pratices to export specific software
informations. It is adding a new field `build_info` so we can extend it
to other parameters if needed in the future.
example output:
# HELP haproxy_process_build_info HAProxy build info.
# TYPE haproxy_process_build_info gauge
haproxy_process_build_info{version="2.4-dev5-2e1a3f-5"} 1
Even though it is not a bugfix, this patch will make more sense when
backported up to >= 2.0
Signed-off-by: William Dauchy <wdauchy@gmail.com>
(cherry picked from commit 5a982a71656ce885be4b1d4b90b8db31204788a1)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit d97162cc94eafff8bd0e67f69ad5f75f59ceaf97)
[wt: context in stats-t.h]
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit ce3e98eb1f9240b7633c5de6855dd115e61708ae)
[wt: adjusted include file names (version.h is in common)]
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit ab210b6efde62f4e22f5a000faf9858ae3b72982)
[wt: adjusted context in stats.h -- no INF_DEBUG_COMMANDS_ISSUED there]
Signed-off-by: Willy Tarreau <w@1wt.eu>
2 files changed