Skip to content

Commit

Permalink
Merge pull request #65 from dricoco/dricoco-patch-1
Browse files Browse the repository at this point in the history
Adding prometheus metrics in stats
  • Loading branch information
goldyfruit authored Oct 17, 2022
2 parents 356253b + 2fc52cf commit 3ff0a2c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ haproxy_stats_options:
- show-legends
- show-node
- hide-version
haproxy_stats_http_requests:
- use-service prometheus-exporter if { path /metrics }
haproxy_stats_listener_options:
- dontlog-normal
haproxy_stats_timeouts:
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ haproxy_stats_options:
- show-node
- hide-version
haproxy_stats_listener_options: []
haproxy_stats_http_requests: []
haproxy_stats_timeouts:
- client 100s
- server 100s
Expand Down
3 changes: 3 additions & 0 deletions templates/etc/haproxy/haproxy-stats.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ listen stats
{% for listener_opt in haproxy_stats_listener_options %}
option {{ listener_opt }}
{% endfor %}
{% for http_request in haproxy_stats_http_requests %}
http-request {{ http_request }}
{% endfor %}
{% if haproxy_stats_timeouts is defined and haproxy_stats_timeouts|length %}
{% for timeout in haproxy_stats_timeouts %}
timeout {{ timeout }}
Expand Down

0 comments on commit 3ff0a2c

Please sign in to comment.