~aluria/+junk/canonical-bootstack-prometheus-0.15.0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{{ template "head" . }}

{{ template "prom_content_head" . }}
<h1>HAProxy Backends</h1>

<table class="table table-condensed table-striped table-bordered" style="width: 0%">
<tr>
  <th>Backend</th>
  <th>Servers Healthy</th>
  <th>Responses</th>
  <th>Sessions</th>
  <th>Queue</th>
</tr>
{{ range query "count by (backend)(haproxy_backend_http_responses_total{job='haproxy'})" | sortByLabel "backend" }}
<tr>
  <td><a href="haproxy-backend.html?backend={{ .Labels.backend }}">{{ .Labels.backend }}</a></td>
  <td>{{ template "prom_query_drilldown" (args (printf "sum(min by (server)(haproxy_server_up{job='haproxy',backend='%s'}))" .Labels.backend)) }} / {{ template "prom_query_drilldown" (args (printf "count(sum by (server)(haproxy_server_up{job='haproxy',backend='%s'}))" .Labels.backend))}}</tdd>
  <td>{{ template "prom_query_drilldown" (args (printf "sum by(backend)(rate(haproxy_backend_http_responses_total{job='haproxy',backend='%s'}[5m]))" .Labels.backend) "/s" "humanizeNoSmallPrefix") }}</td>
  <td>{{ template "prom_query_drilldown" (args (printf "sum by(backend)(haproxy_backend_current_sessions{job='haproxy',backend='%s'})" .Labels.backend) "" "humanize") }}</td>
  <td>{{ template "prom_query_drilldown" (args (printf "sum by(backend)(haproxy_backend_current_queue{job='haproxy',backend='%s'})" .Labels.backend) "" "humanize") }}</td>
</tr>
{{ else }}
<tr><td colspan=4>No backends found.</td></tr>
{{ end }}


{{ template "prom_content_tail" . }}

{{ template "tail" }}