REGTESTS: contrib/prometheus-exporter: test well known labels
authorWilliam Dauchy <wdauchy@gmail.com>
Thu, 18 Feb 2021 22:05:34 +0000 (23:05 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 19 Feb 2021 17:03:59 +0000 (18:03 +0100)
as we previously briefly broke labels handling, test them to make sure
we don't introduce regressions in the future.
see also commit 040b1195f70d6a24204ede081451fd1dd71e6a34 ("BUG/MINOR:
contrib/prometheus-exporter: Restart labels dump at the right pos") for
reference

Signed-off-by: William Dauchy <wdauchy@gmail.com>

reg-tests/contrib/prometheus.vtc

index 1ebeb29..ebe0b87 100644 (file)
@@ -71,6 +71,15 @@ client c1 -connect ${h1_stats_sock} {
        expect resp.body ~ ".*haproxy_server_idle_connections_limit{proxy=\"be\",server=\"s1\"} NaN.*"
        expect resp.body ~ ".*haproxy_server_idle_connections_limit{proxy=\"be\",server=\"s2\"} 42.*"
 
+       # test well known labels presence
+       expect resp.body ~ ".*haproxy_process_build_info{version=\".*\"} 1.*"
+       expect resp.body ~ ".*haproxy_frontend_http_responses_total{proxy=\"stats\",code=\"4xx\"} 0.*"
+       expect resp.body ~ ".*haproxy_frontend_status{proxy=\"fe\",state=\"UP\"} 1.*"
+       expect resp.body ~ ".*haproxy_listener_status{proxy=\"stats\",listener=\"sock-1\",state=\"WAITING\"} 0.*"
+       expect resp.body ~ ".*haproxy_backend_status{proxy=\"be\",state=\"UP\"} 1.*"
+       expect resp.body ~ ".*haproxy_server_status{proxy=\"be\",server=\"s1\",state=\"DOWN\"} 0.*"
+       expect resp.body ~ ".*haproxy_server_check_status{proxy=\"be\",server=\"s2\",state=\"HANA\"} 0.*"
+
        # test scope
        txreq -url "/metrics?scope="
        rxresp