Commit 7ebd74b8 authored by Brian Brazil's avatar Brian Brazil Committed by GitHub

Cut down console template examples to just node and prometheus (#3099)

These haven't seen much love, and grafana.com dashboard sharing
has become more promiment. Keep 2 for the sake of demos.
parent 41884f02
......@@ -31,40 +31,6 @@
<ul>
{{ template "_menuItem" (args . "index.html.example" "Overview") }}
{{ if query "up{job='haproxy'}" }}
{{ template "_menuItem" (args . "haproxy.html" "HAProxy") }}
{{ if match "^haproxy" .Path }}
<ul>
{{ template "_menuItem" (args . "haproxy-frontends.html" "Frontends") }}
{{ if .Params.frontend }}
<li>
<ul>
<li>
<a href="haproxy-frontend.html?frontend={{ .Params.frontend }}">{{ .Params.frontend }}</a></li>
</ul>
</li>
{{ end }}
{{ template "_menuItem" (args . "haproxy-backends.html" "Backends") }}
{{ if .Params.backend }}
<li>
<ul>
<li>
<a href="haproxy-backend.html?backend={{ .Params.backend }}">{{ .Params.backend }}</a></li>
</ul>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}
{{ if query "up{job='cassandra'}" }}
{{ template "_menuItem" (args . "cassandra.html" "Cassandra") }}
{{ end }}
{{ if query "up{job='blackbox'}" }}
{{ template "_menuItem" (args . "blackbox.html" "Blackbox") }}
{{ end }}
{{ if query "up{job='node'}" }}
{{ template "_menuItem" (args . "node.html" "Node") }}
{{ if match "^node" .Path }}
......@@ -99,44 +65,6 @@
{{ end }}
{{ end }}
{{ if query "up{job='snmp'}" }}
{{ template "_menuItem" (args . "snmp.html" "SNMP") }}
{{ if match "^snmp" .Path }}
{{ if .Params.instance }}
<ul>
<li {{ if eq .Path "snmp-overview.html" }}class="prom_lhs_menu_selected"{{ end }}>
<a href="snmp-overview.html?instance={{ .Params.instance }}">{{.Params.instance }}</a>
</li>
</ul>
{{ end }}
{{ end }}
{{ end }}
{{ if query "up{job='cloudwatch'}" }}
{{ template "_menuItem" (args . "cloudwatch.html" "CloudWatch") }}
{{ end }}
{{ if query "aws_elasticache_cpuutilization_average{job='aws_elasticache'}" }}
{{ template "_menuItem" (args . "aws_elasticache.html" "ElastiCache") }}
{{ end }}
{{ if query "aws_elb_healthy_host_count_average{job='aws_elb'}" }}
{{ template "_menuItem" (args . "aws_elb.html" "ELB") }}
{{ end }}
{{ if query "aws_redshift_health_status_average{job='aws_redshift'}" }}
{{ template "_menuItem" (args . "aws_redshift.html" "Redshift") }}
{{ if and (eq "aws_redshift-cluster.html" .Path) .Params.cluster_identifier }}
<ul>
<li class="prom_lhs_menu_selected">
{{ reReplaceAll "^(.{8}).{8,}(.{8})$" "$1...$2" .Params.cluster_identifier }}
</li>
</ul>
{{ end }}
{{ end }}
</ul>
</div>
{{ end }}
......
{{ template "head" . }}
{{ template "prom_right_table_head" }}
{{ range printf "sum by (cache_cluster_id)(aws_elasticache_cpuutilization_average{job='aws_elasticache'})" | query | sortByLabel "cache_cluster_id" }}
<tr>
<th colspan="2">{{ .Labels.cache_cluster_id }}</th>
</tr>
<tr>
<td>CPU</td>
<td>{{ template "prom_query_drilldown" (args (printf "aws_elasticache_cpuutilization_average{job='aws_elasticache',cache_cluster_id='%s'}" .Labels.cache_cluster_id) "%" "printf.3g") }}</td>
</tr>
<tr>
<td>Cache Size</td>
<td>{{ template "prom_query_drilldown" (args (printf "aws_elasticache_bytes_used_for_cache_average{job='aws_elasticache',cache_cluster_id='%s'}" .Labels.cache_cluster_id) "B" "humanize1024") }}</td>
</tr>
<tr>
<td>Cache Items</td>
<td>{{ template "prom_query_drilldown" (args (printf "aws_elasticache_curr_items_average{job='aws_elasticache',cache_cluster_id='%s'}" .Labels.cache_cluster_id) "" "humanize") }}</td>
</tr>
<tr>
<td>Freeable Memory</td>
<td>{{ template "prom_query_drilldown" (args (printf "aws_elasticache_freeable_memory_average{job='aws_elasticache',cache_cluster_id='%s'}" .Labels.cache_cluster_id) "B" "humanize1024") }}</td>
</tr>
{{ end }}
{{ template "prom_right_table_tail" }}
{{ template "prom_content_head" . }}
<h1>AWS ElastiCache</h1>
<h3>CPU</h3>
<div id="queryGraph"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#queryGraph"),
expr: "sum by (cache_cluster_id)(aws_elasticache_cpuutilization_average{job='aws_elasticache'})",
name: "[[cache_cluster_id]]",
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yUnits: "%",
yTitle: "CPU"
})
</script>
{{ template "prom_content_tail" . }}
{{ template "tail" }}
{{ template "head" . }}
{{ template "prom_right_table_head" }}
{{ range query "sum by (load_balancer_name)(aws_elb_healthy_host_count_average{job='aws_elb'})" | sortByLabel "load_balancer_name" }}
<tr>
<th colspan="2">{{ .Labels.load_balancer_name }}</th>
</tr>
<tr>
<td>Healthy Hosts</td>
<td>{{ template "prom_query_drilldown" (args (printf "avg(aws_elb_healthy_host_count_average{job='aws_elb',load_balancer_name='%s'})" .Labels.load_balancer_name) ) }} / {{ template "prom_query_drilldown" (args (printf "avg(aws_elb_healthy_host_count_average{job='aws_elb',load_balancer_name='%s'}) + avg(aws_elb_un_healthy_host_count_average{job='aws_elb',load_balancer_name='%s'})" .Labels.load_balancer_name .Labels.load_balancer_name) ) }}</td>
</tr>
<tr>
<td>Queries</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(aws_elb_request_count_sum{job='aws_elb',load_balancer_name='%s'}) / 60" .Labels.load_balancer_name) "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Latency</td>
<td>{{ template "prom_query_drilldown" (args (printf "avg(aws_elb_latency_average{job='aws_elb',load_balancer_name='%s'})" .Labels.load_balancer_name) "s" "humanize") }}</td>
</tr>
<tr>
<td>Surge Queue</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(aws_elb_surge_queue_length_sum{job='aws_elb',load_balancer_name='%s'})" .Labels.load_balancer_name) "" "humanize") }}</td>
</tr>
{{ end }}
{{ template "prom_right_table_tail" }}
{{ template "prom_content_head" . }}
<h1>AWS Elastic Load Balancer</h1>
<p><em>This console assumes that <code>period_seconds</code> in the CloudWatch Exporter is the default of 60s.</em></p>
<h3>Queries</h3>
<div id="queryGraph"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#queryGraph"),
expr: "sum by (load_balancer_name)(aws_elb_request_count_sum{job='aws_elb'}) / 60",
name: "[[load_balancer_name]]",
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yUnits: "/s",
yTitle: "Queries"
})
</script>
{{ template "prom_content_tail" . }}
{{ template "tail" }}
{{ template "head" . }}
{{ template "prom_right_table_head" }}
<tr>
<td>Nodes</td>
<td>{{ template "prom_query_drilldown" (args (printf "count(aws_redshift_percentage_disk_space_used_average{job='aws_redshift',cluster_identifier='%s'})" .Params.cluster_identifier)) }}</td>
</tr>
<tr>
<td>Healthy</td>
<td>{{ with printf "aws_redshift_health_status_average{job='aws_redshift',cluster_identifier='%s'}" .Params.cluster_identifier | query }}{{ if eq (. | first | value) 1.0 }}Yes{{ else }}No{{ end }} {{ end }}</td>
</tr>
<tr>
<td>Maintenance mode</td>
<td>{{ with printf "aws_redshift_maintenance_mode_average{job='aws_redshift',cluster_identifier='%s'}" .Params.cluster_identifier | query }}{{ if eq (. | first | value) 1.0 }}Yes{{ else }}No{{ end }} {{ end }}</td>
</tr>
<tr>
<td>Connections</td>
<td>{{ template "prom_query_drilldown" (args (printf "aws_redshift_database_connections_average{job='aws_redshift',cluster_identifier='%s'}" .Params.cluster_identifier)) }}</td>
</tr>
<tr>
<td>CPU</td>
<td>{{ template "prom_query_drilldown" (args (printf "avg(aws_redshift_cpuutilization_average{job='aws_redshift',cluster_identifier='%s'})" .Params.cluster_identifier) "%" "printf.3g") }}</td>
</tr>
<tr>
<td>Disk Used</td>
<td>{{ template "prom_query_drilldown" (args (printf "max(aws_redshift_percentage_disk_space_used_average{job='aws_redshift',cluster_identifier='%s'})" .Params.cluster_identifier) "%" "printf.3g") }}</td>
</tr>
<tr>
<td>Network Transmitted</td>
<td>{{ template "prom_query_drilldown" (args (printf "avg(aws_redshift_network_transmit_throughput_average{job='aws_redshift',cluster_identifier='%s'})" .Params.cluster_identifier) "B/s" "humanize") }}</td>
</tr>
<tr>
<td>Network Received</td>
<td>{{ template "prom_query_drilldown" (args (printf "avg(aws_redshift_network_receive_throughput_average{job='aws_redshift',cluster_identifier='%s'})" .Params.cluster_identifier) "B/s" "humanize") }}</td>
</tr>
<tr>
<td>Read Throughput</td>
<td>{{ template "prom_query_drilldown" (args (printf "avg(aws_redshift_read_throughput_average{job='aws_redshift',cluster_identifier='%s'})" .Params.cluster_identifier) "B/s" "humanize") }}</td>
</tr>
<tr>
<td>Read IOPS</td>
<td>{{ template "prom_query_drilldown" (args (printf "avg(aws_redshift_read_iops_average{job='aws_redshift',cluster_identifier='%s'})" .Params.cluster_identifier) "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Read Latency</td>
<td>{{ template "prom_query_drilldown" (args (printf "avg(aws_redshift_read_latency_average{job='aws_redshift',cluster_identifier='%s'})" .Params.cluster_identifier) "s" "humanize") }}</td>
</tr>
<tr>
<td>Write Throughput</td>
<td>{{ template "prom_query_drilldown" (args (printf "avg(aws_redshift_write_throughput_average{job='aws_redshift',cluster_identifier='%s'})" .Params.cluster_identifier) "B/s" "humanize") }}</td>
</tr>
<tr>
<td>Write IOPS</td>
<td>{{ template "prom_query_drilldown" (args (printf "avg(aws_redshift_write_iops_average{job='aws_redshift',cluster_identifier='%s'})" .Params.cluster_identifier) "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Write Latency</td>
<td>{{ template "prom_query_drilldown" (args (printf "avg(aws_redshift_write_latency_average{job='aws_redshift',cluster_identifier='%s'})" .Params.cluster_identifier) "s" "humanize") }}</td>
</tr>
{{ template "prom_right_table_tail" }}
{{ template "prom_content_head" . }}
<h1>AWS Redshift</h1>
<p><strong>Cluster:</strong> {{ .Params.cluster_identifier }}</p>
<h3>CPU Usage</h3>
<div id="cpuGraph"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#cpuGraph"),
expr: "aws_redshift_cpuutilization_average{job='aws_redshift',cluster_identifier='{{ .Params.cluster_identifier }}'}",
name: '[[ node_id ]]',
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yUnits: "%",
yTitle: 'CPU'
})
</script>
{{ template "prom_content_tail" . }}
{{ template "tail" }}
{{ template "head" . }}
{{ template "prom_content_head" . }}
<h1>AWS Redshift</h1>
<h3>Overview</h3>
<table class="table table-condensed table-striped table-bordered" style="width: 0%">
<tr>
<th>Cluster</th>
<th>Healthy</th>
<th>Maintenance Mode</th>
<th>Nodes</th>
<th>Disk Used</th>
</tr>
{{ range printf "sum by (cluster_identifier)(aws_redshift_health_status_average{job='aws_redshift'})" | query | sortByLabel "cluster_identifier" }}
<tr>
<td><a href="aws_redshift-cluster.html?cluster_identifier={{ .Labels.cluster_identifier }}">{{ .Labels.cluster_identifier }}</a></td>
<td>{{ with printf "aws_redshift_health_status_average{job='aws_redshift',cluster_identifier='%s'}" .Labels.cluster_identifier | query }}{{ if eq (. | first | value) 1.0 }}Yes{{ else }}No{{ end }} {{ end }}</td>
<td>{{ with printf "aws_redshift_maintenance_mode_average{job='aws_redshift',cluster_identifier='%s'}" .Labels.cluster_identifier | query }}{{ if eq (. | first | value) 1.0 }}Yes{{ else }}No{{ end }} {{ end }}</td>
<td>{{ template "prom_query_drilldown" (args (printf "count(aws_redshift_percentage_disk_space_used_average{job='aws_redshift',cluster_identifier='%s'})" .Labels.cluster_identifier)) }}</td>
<td>{{ template "prom_query_drilldown" (args (printf "max(aws_redshift_percentage_disk_space_used_average{job='aws_redshift',cluster_identifier='%s'})" .Labels.cluster_identifier) "%" "printf.3g") }}</td>
</tr>
{{ end }}
</table>
{{ template "prom_content_tail" . }}
{{ template "tail" }}
{{ template "head" . }}
{{ template "prom_right_table_head" }}
<tr>
<th>Blackbox</th>
<th>{{ template "prom_query_drilldown" (args "sum(up{job='blackbox'})") }} / {{ template "prom_query_drilldown" (args "count(up{job='blackbox'})") }}</th>
</tr>
<tr>
<th colspan=2>Currently</th>
</tr>
{{ range query "probe_success{job='blackbox'}" | sortByLabel "instance" }}
<tr>
<td>
<a href="http://{{ .Labels.instance }}/">{{ .Labels.instance }}</a></td>
<td {{ if eq (. | value) 1.0 }}>Up{{ else }} class="alert-danger">Down{{ end }}</td>
</tr>
{{ end }}
<tr>
<th colspan=2>Past Day %</th>
</tr>
{{ range query "avg_over_time(probe_success{job='blackbox'}[1d]) * 100" | sortByLabel "instance" }}
<tr>
<td>{{ .Labels.instance }}</td>
<td {{ if gt (. | value) 90.0 }}{{ else }} class="alert-danger"{{ end }}>
{{ (. | value | printf "%.2f") }}%</td>
</tr>
{{ end }}
{{ template "prom_right_table_tail" }}
{{ template "prom_content_head" .}}
<h1>Blackbox</h1>
<h3>Response times</h3>
<div id="responseGraph"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#responseGraph"),
expr: "probe_duration_seconds{job='blackbox'}",
name: "[[instance]]",
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yUnits: "s",
yTitle: "response time"
})
</script>
{{ template "prom_content_tail" . }}
{{ template "tail" }}
{{ template "head" . }}
{{ template "prom_right_table_head" }}
{{ template "prom_right_table_job_head" "cassandra" }}
<tr>
<td>Queries</td>
<td>{{ template "prom_query_drilldown" (args "sum by (job)(irate(cassandra_clientrequest_latency{job='cassandra'}[5m]))" "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Timeout Ratio</td>
<td>{{ template "prom_query_drilldown" (args "sum by (job)(irate(cassandra_clientrequest_timeouts{job='cassandra'}[5m])) / sum by (job)(irate(cassandra_clientrequest_latency{job='cassandra'}[5m]))" "" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Unavailable Ratio</td>
<td>{{ template "prom_query_drilldown" (args "sum by (job)(irate(cassandra_clientrequest_unavailables{job='cassandra'}[5m])) / sum by (job)(irate(cassandra_clientrequest_latency{job='cassandra'}[5m]))" "" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr><th colspan="2">Internals</th></tr>
<tr>
<td>Hints Inprogress</td>
<td>{{ template "prom_query_drilldown" (args "sum by (job)(cassandra_storage_totalhintsinprogress{job='cassandra'})" "" "humanize") }}</td>
</tr>
<tr>
<td>Blocked Tasks</td>
<td>{{ template "prom_query_drilldown" (args "sum by (job)(cassandra_threadpools_currentlyblockedtasks{job='cassandra'})" "" "humanize") }}</td>
</tr>
<tr><th colspan="2">Average Node Disk</th></tr>
<tr>
<td>Compacted</td>
<td>{{ template "prom_query_drilldown" (args "avg by (job)(irate(cassandra_compaction_bytescompacted{job='cassandra'}[5m]))" "B/s" "humanize1024") }}</td>
</tr>
<tr>
<td>Live CF</td>
<td>{{ template "prom_query_drilldown" (args "avg by (job)(sum by (job, instance)(cassandra_columnfamily_totaldiskspaceused{job='cassandra'}))" "B" "humanize1024") }}</td>
</tr>
<tr>
<td>Total CF</td>
<td>{{ template "prom_query_drilldown" (args "avg by (job)(sum by (job, instance)(cassandra_columnfamily_totaldiskspaceused{job='cassandra'}))" "B" "humanize1024") }}</td>
</tr>
<tr>
<td>Commit Log</td>
<td>{{ template "prom_query_drilldown" (args "avg by (job)(cassandra_commitlog_totalcommitlogsize{job='cassandra'})" "B" "humanize1024") }}</td>
</tr>
{{ template "prom_right_table_tail" }}
{{ template "prom_content_head" .}}
<h1>Cassandra</h1>
<h3>Client Queries</h3>
<div id="queryGraph"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#queryGraph"),
expr: "sum by (job, clientrequest)(irate(cassandra_clientrequest_latency{job='cassandra'}[5m]))",
name: "[[clientrequest]]",
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yUnits: "/s",
yTitle: "Queries"
})
</script>
<h3>Client Latency</h3>
<div id="latencyGraph"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#latencyGraph"),
expr: "sum by (job, clientrequest)(irate(cassandra_clientrequest_totallatency{job='cassandra'}[5m])) / sum by (job, clientrequest)(irate(cassandra_clientrequest_latency{job='cassandra'}[5m])) / 1000000",
name: "[[clientrequest]]",
yAxisFormatter: PromConsole.NumberFormatter.humanize,
yHoverFormatter: PromConsole.NumberFormatter.humanize,
yUnits: "s",
yTitle: "Latency"
})
</script>
{{ template "prom_content_tail" . }}
{{ template "tail" }}
{{ template "head" . }}
{{ template "prom_right_table_head" }}
<tr>
<th>cloudwatch</th>
<th>{{ template "prom_query_drilldown" (args "sum(up{job='cloudwatch'})") }} / {{ template "prom_query_drilldown" (args "count(up{job='cloudwatch'})") }}</th>
</tr>
<tr>
<td>API Requests</td>
<td>{{ template "prom_query_drilldown" (args "sum by (job)(irate(cloudwatch_requests_total{job='cloudwatch'}[5m]))" "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
{{ template "prom_right_table_tail" }}
{{ template "prom_content_head" . }}
<h1>CloudWatch Exporter</h1>
{{ template "prom_content_tail" . }}
{{ template "tail" }}
{{ template "head" . }}
{{ template "prom_right_table_head" }}
<tr><th>{{ .Params.backend }}</th><th>{{ template "prom_query_drilldown" (args (printf "sum(min by (server)(haproxy_server_up{job='haproxy',backend='%s'}))" .Params.backend)) }} / {{ template "prom_query_drilldown" (args (printf "count(sum by (server)(haproxy_server_up{job='haproxy',backend='%s'}))" .Params.backend))}}</th></tr>
<tr>
<td>Responses</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(haproxy_backend_http_responses_total{job='haproxy',backend='%s'}[5m]))" .Params.backend) "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Data In</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(haproxy_backend_bytes_in_total{job='haproxy',backend='%s'}[5m]))" .Params.backend) "B/s" "humanize") }}</td>
</tr>
<tr>
<td>Data Out</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(haproxy_backend_bytes_out_total{job='haproxy',backend='%s'}[5m]))" .Params.backend) "B/s" "humanize") }}</td>
</tr>
<tr>
<td>Current Sessions</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(haproxy_backend_current_sessions{job='haproxy',backend='%s'})" .Params.backend) "" "humanize") }}</td>
</tr>
<tr>
<td>Current Queue</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(haproxy_backend_current_queue{job='haproxy',backend='%s'})" .Params.backend) "" "humanize") }}</td>
</tr>
<tr><th colspan="2">Server Errors</th></tr>
<tr>
<td>Connection Errors</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(haproxy_backend_connection_errors_total{job='haproxy',backend='%s'}[5m]))" .Params.backend) "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Response Errors</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(haproxy_backend_connection_errors_total{job='haproxy',backend='%s'}[5m]))" .Params.backend) "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Retry Warnings</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(haproxy_backend_retry_warnings_total{job='haproxy',backend='%s'}[5m]))" .Params.backend) "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
{{ template "prom_right_table_tail" }}
{{ template "prom_content_head" . }}
<h1>HAProxy Backend - {{ .Params.backend }}</h1>
<h3>Responses</h3>
<div id="responsesGraph"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#responsesGraph"),
expr: "sum by (code)(irate(haproxy_backend_http_responses_total{job='haproxy',backend='{{ .Params.backend }}'}[5m]))",
renderer: 'area',
yTitle: 'Queries',
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yUnits: '/s'
})
</script>
{{ template "prom_content_tail" . }}
{{ template "tail" }}
{{ 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)(irate(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" }}
{{ template "head" . }}
{{ template "prom_right_table_head" }}
<tr><th colspan="2">{{ .Params.frontend }}</th></tr>
<tr>
<td>Requests</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(haproxy_frontend_http_requests_total{job='haproxy',frontend='%s'}[5m]))" .Params.frontend) "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Requests Denied</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(haproxy_frontend_requests_denied_total{job='haproxy',frontend='%s'}[5m]))" .Params.frontend) "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Data In</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(haproxy_frontend_bytes_in_total{job='haproxy',frontend='%s'}[5m]))" .Params.frontend) "B/s" "humanize") }}</td>
</tr>
<tr>
<td>Data Out</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(haproxy_frontend_bytes_out_total{job='haproxy',frontend='%s'}[5m]))" .Params.frontend) "B/s" "humanize") }}</td>
</tr>
<tr>
<td>Current Sessions</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum(haproxy_frontend_current_sessions{job='haproxy',frontend='%s'})" .Params.frontend) "" "humanize") }}</td>
</tr>
{{ template "prom_right_table_tail" }}
{{ template "prom_content_head" . }}
<h1>HAProxy Frontend - {{ .Params.frontend }}</h1>
<h3>Responses</h3>
<div id="responsesGraph"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#responsesGraph"),
expr: "sum by (code)(irate(haproxy_frontend_http_responses_total{job='haproxy',frontend='{{ .Params.frontend }}'}[5m]))",
renderer: 'area',
yTitle: 'Queries',
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yUnits: ' /s'
})
</script>
{{ template "prom_content_tail" . }}
{{ template "tail" }}
{{ template "head" . }}
{{ template "prom_content_head" . }}
<h1>HAProxy Frontends</h1>
<table class="table table-condensed table-striped table-bordered" style="width: 0%">
<tr>
<th>Frontend</th>
<th>Requests</th>
<th>Sessions</th>
</tr>
{{ range query "count by (frontend)(haproxy_frontend_http_requests_total{job='haproxy'})" | sortByLabel "frontend" }}
<tr>
<td><a href="haproxy-frontend.html?frontend={{ .Labels.frontend }}">{{ .Labels.frontend }}</a></td>
<td>{{ template "prom_query_drilldown" (args (printf "sum by(frontend)(irate(haproxy_frontend_http_requests_total{job='haproxy',frontend='%s'}[5m]))" .Labels.frontend) "/s" "humanizeNoSmallPrefix") }}</td>
<td>{{ template "prom_query_drilldown" (args (printf "sum by(frontend)(haproxy_frontend_current_sessions{job='haproxy',frontend='%s'})" .Labels.frontend) "" "humanize") }}</td>
</tr>
{{ else }}
<tr><td colspan=4>No frontends found.</td></tr>
{{ end }}
{{ template "prom_content_tail" . }}
{{ template "tail" }}
{{ template "head" . }}
{{ template "prom_right_table_head" }}
<tr>
<th>HAProxy</th>
<th>{{ template "prom_query_drilldown" (args "sum(haproxy_up{job='haproxy'})") }} / {{ template "prom_query_drilldown" (args "count(up{job='haproxy'})") }}</th></tr>
</tr>
<tr>
<td>CPU</td>
<td>{{ template "prom_query_drilldown" (args "avg by(job)(irate(haproxy_process_cpu_seconds_total{job='haproxy'}[5m]))" "s/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Memory</td>
<td>{{ template "prom_query_drilldown" (args "avg by(job)(haproxy_process_resident_memory_bytes{job='haproxy'})" "B" "humanize1024") }}</td>
</tr>
<tr>
<th colspan="2">Frontend</th>
</tr>
<tr>
<td>Requests</td>
<td>{{ template "prom_query_drilldown" (args "sum(irate(haproxy_frontend_http_requests_total{job='haproxy'}[5m]))" "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Requests Denied</td>
<td>{{ template "prom_query_drilldown" (args "sum(irate(haproxy_frontend_requests_denied_total{job='haproxy'}[5m]))" "/s" "humanizeNoSmallPrefix") }}</td>
</tr>
<tr>
<td>Data In</td>
<td>{{ template "prom_query_drilldown" (args "sum(irate(haproxy_frontend_bytes_in_total{job='haproxy'}[5m]))" "B/s" "humanize") }}</td>
</tr>
<tr>
<td>Data Out</td>
<td>{{ template "prom_query_drilldown" (args "sum(irate(haproxy_frontend_bytes_out_total{job='haproxy'}[5m]))" "B/s" "humanize") }}</td>
</tr>
<tr>
<td>Current Sessions</td>
<td>{{ template "prom_query_drilldown" (args "sum(haproxy_frontend_current_sessions{job='haproxy'})" "" "humanize") }}</td>
</tr>
{{ template "prom_right_table_tail" }}
{{ template "prom_content_head" . }}
<h1>HAProxy</h1>
<h3>Frontend Requests</h3>
<div id="feRequestsGraph"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#feRequestsGraph"),
expr: "sum by (frontend)(irate(haproxy_frontend_http_requests_total{job='haproxy'}[5m]))",
renderer: 'area',
yTitle: 'Requests',
name: '[[ frontend ]]',
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yUnits: '/s'
})
</script>
<h3>Backend Responses</h3>
<div id="responsesGraph"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#responsesGraph"),
expr: "sum by (backend)(irate(haproxy_backend_http_responses_total{job='haproxy'}[5m]))",
renderer: 'area',
yTitle: 'Responses',
name: '[[ backend ]]',
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yUnits: '/s'
})
</script>
<h3>Current Sessions</h3>
<div id="sessionsGraph"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#sessionsGraph"),
expr: "sum(haproxy_frontend_current_sessions{job='haproxy'})",
yTitle: 'Sessions',
name: 'Sessions'
})
</script>
{{ template "prom_content_tail" . }}
{{ template "tail" }}
......@@ -5,7 +5,7 @@
{{ template "prom_content_head" . }}
<h1>Overview</h1>
<p>These are example consoles for Prometheus, they are still under development.</p>
<p>These are example consoles for Prometheus.</p>
<p>These consoles expect exporters to have the following job labels:</p>
<table class="table table-condensed table-striped table-bordered" style="width: 0%">
......@@ -21,26 +21,6 @@
<td>Prometheus</td>
<td><code>prometheus</code></td>
</tr>
<tr>
<td>SNMP Exporter</td>
<td><code>snmp</code></td>
</tr>
<tr>
<td>HAProxy Exporter</td>
<td><code>haproxy</code></td>
</tr>
<tr>
<td>CloudWatch Exporter</td>
<td><code>cloudwatch</code></td>
</tr>
<tr>
<td>Cassandra (JMX Exporter)</td>
<td><code>cassandra</code></td>
</tr>
<tr>
<td>Blackbox (Prober)</td>
<td><code>blackbox</code></td>
</tr>
</table>
{{ template "prom_content_tail" . }}
......
{{ template "head" . }}
{{ template "prom_content_head" . }}
<h1>SNMP Device Overview - {{ .Params.instance }}</h1>
<table class="table table-condensed table-striped table-bordered" style="width: 0%">
<tr>
<th>Port</th>
<th>Status</th>
<th>Speed</th>
<th>In</th>
<th>Out</th>
<th>Discards</th>
<th>Errors</th>
</tr>
{{ range query (printf "ifOperStatus{job='snmp',instance='%s'}" .Params.instance) | sortByLabel "ifDescr" }}
<tr>
<td class="text-right">{{ .Labels.ifDescr }}</a></td>
<td class="text-right {{ if eq (. | value) 1.0 }}success">up
{{ else if eq (. | value) 2.0}}">down
{{ else if eq (. | value) 3.0}}">testing
{{ else if eq (. | value) 4.0}}">unknown