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:
2 changed files with 7 additions and 0 deletions
@@ -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
@@ -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
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.