Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
haproxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Roles
haproxy
Commits
85ad7bbb
Commit
85ad7bbb
authored
1 year ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Add support for prometheus
parent
c46b0788
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/haproxy_cfg.jinja2
+16
-0
16 additions, 0 deletions
templates/haproxy_cfg.jinja2
with
16 additions
and
0 deletions
templates/haproxy_cfg.jinja2
+
16
−
0
View file @
85ad7bbb
...
...
@@ -163,6 +163,10 @@ frontend http_in
acl kibana_present hdr(host) -i -n '{{ kibana_domain|default(inventory_hostname) }}'
use_backend backend_redirect_ssl if kibana_present
{% endif %}
{% for prometheus in prometheus_settings|default([]) %}
acl prometheus_{{ prometheus.id }}_present hdr(host) -i -n '{{ prometheus.domain|default(inventory_hostname) }}'
use_backend backend_redirect_ssl if prometheus_{{ prometheus.id }}_present
{% endfor %}
{% if 'webserver' in groups %}
{% for host in groups['webserver']|sort %}
http-request set-header x-routing-host {{ host }} if !letsencrypt_challenge { hdr(x-routing-host) undefined } { hdr(host) -i -n -f /etc/haproxy/{{host}}.list }
...
...
@@ -318,6 +322,10 @@ frontend https_in_{{ cert.ip }}
acl kibana_present hdr(host) -i -n '{{ kibana_domain|default(inventory_hostname) }}'
use_backend backend_kibana if kibana_present
{% endif %}
{% for prometheus in prometheus_settings|default([]) %}
acl prometheus_{{ prometheus.id }}_present hdr(host) -i -n '{{ prometheus.domain|default(inventory_hostname) }}'
use_backend backend_prometheus_{{ prometheus.id }} if prometheus_{{ prometheus.id }}_present
{% endfor %}
{% for external in cert.external|default([]) %}
acl is_{{ external.key }} {{ external.acl }}
use_backend backend_{{ external.key }} if is_{{ external.key }}
...
...
@@ -527,6 +535,14 @@ backend backend_kibana
{% endif %}
server kibana 127.0.0.1:5601 check maxconn 32
{% endif %}
{% for prometheus in prometheus_settings|default([]) %}
backend backend_prometheus_{{ prometheus.id }}
{% if proxy_debug %}
http-response set-header X-Proxy-Backend "prometheus_{{ prometheus.id }}"
{% endif %}
server prometheus_{{ prometheus.id }} 127.0.0.1:{{ prometheus.port }} check maxconn 32
{% endfor %}
backend backend_maintenance
{% if proxy_debug %}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment