Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Add stats service to haproxy
Browse files Browse the repository at this point in the history
Allow the stats service for HAProxy to be configured.

Change-Id: Ie2c9d6efc48dc4200c8136e8345c2a0a66570348
  • Loading branch information
greghaynes committed Jun 26, 2014
1 parent 2bd4ab2 commit 2e0b7f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion elements/haproxy/README.md
Expand Up @@ -10,6 +10,9 @@ The following properties are supported for configuring haproxy
proxy_port sub-properties.
* haproxy.nodes: A list of server <name> <ip>:<port> lines. These are added to
any haproxy.services which do not define this sub-property.
* haproxy.stats.disabled: Set to true to disable the stats service
* haproxy.stats.port: Port for the stats service. Defaults to 1993.
* haproxy.stats.uri: URI for the stats service. Defaults to /.

Each haproxy.services can define the following sub-properties

Expand Down Expand Up @@ -97,4 +100,4 @@ You can provide net_binds only once, for example:
- ip: 192.0.2.10

If there is no haproxy.services.net_binds.port defined - haproxy.services.port
will be used.
will be used.
7 changes: 7 additions & 0 deletions elements/haproxy/os-config-applier/etc/haproxy/haproxy.cfg
Expand Up @@ -39,4 +39,11 @@ listen {{name}}
server {{name}} {{ip}}:{{port}} check inter 2000 rise 2 fall 5
{{/nodes}}
{{/services}}

{{/haproxy}}

{{^haproxy.stats.disabled}}
listen haproxy.stats :{{#stats.port}}{{stats.port}}{{/stats.port}}{{^stats.port}}1993{{/stats.port}}
stats enable
stats uri {{#stats.uri}}{{stats.uri}}{{/stats.uri}}{{^stats.uri}}/{{/stats.uri}}
{{/haproxy.stats.disabled}}

0 comments on commit 2e0b7f4

Please sign in to comment.