Add configuration option for native prometheus exporter

HAProxy added native Prometheus support from v2.0. This can be
enabled using the existing stats endpoint via an additional
/metrics path.
Change-Id: If9528969c7915db06138c0746dc419d8302f0e7c
This commit is contained in:
Andrew Bonney
2021年07月30日 09:07:50 +01:00
parent 1dc4fa621c
commit 964a33558b

View File

@@ -33,6 +33,9 @@ haproxy_stats_port: 1936
haproxy_username:admin
haproxy_stats_password:secrete
haproxy_stats_refresh_interval:60
# Prometheus stats are supported from HAProxy v2
# Stats must be enabled above before this can be used
haproxy_stats_prometheus_enabled:False
# Pin stats gathering to one or more processes when using 'nbproc' tuning
# For permitted options see https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#3.1-stats%20bind-process
# haproxy_stats_process: all

View File

@@ -46,6 +46,10 @@ listen stats
bind-process {{ haproxy_stats_process }}
{% endif %}
mode http
{% if haproxy_stats_prometheus_enabled | bool %}
option http-use-htx
http-request use-service prometheus-exporter if { path /metrics }
{% endif %}
stats enable
stats hide-version
stats realm Haproxy\ Statistics
Reference in New Issue
openstack/openstack-ansible-haproxy_server
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.