mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-27 22:49:40 -08:00
Merge pull request #465 from brian-brazil/more-consoles
Add consoles for haproxy and cloudwatch.
This commit is contained in:
commit
f071850e41
|
@ -30,6 +30,35 @@
|
|||
<div class="prom_lhs_menu">
|
||||
<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='node'}" }}
|
||||
{{ template "_menuItem" (args . "node.html" "Node") }}
|
||||
{{ if match "^node" .Path }}
|
||||
{{ if .Params.instance }}
|
||||
|
@ -48,8 +77,32 @@
|
|||
</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 }}
|
||||
|
|
45
consoles/aws_elasticache.html
Normal file
45
consoles/aws_elasticache.html
Normal file
|
@ -0,0 +1,45 @@
|
|||
{{ 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>
|
||||
{{ template "prom_content_tail" . }}
|
||||
|
||||
<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 "tail" }}
|
46
consoles/aws_elb.html
Normal file
46
consoles/aws_elb.html
Normal file
|
@ -0,0 +1,46 @@
|
|||
{{ 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>
|
||||
{{ template "prom_content_tail" . }}
|
||||
<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 "tail" }}
|
83
consoles/aws_redshift-cluster.html
Normal file
83
consoles/aws_redshift-cluster.html
Normal file
|
@ -0,0 +1,83 @@
|
|||
{{ 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" }}
|
28
consoles/aws_redshift.html
Normal file
28
consoles/aws_redshift.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
{{ 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" }}
|
19
consoles/cloudwatch.html
Normal file
19
consoles/cloudwatch.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
{{ 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)(rate(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" }}
|
58
consoles/haproxy-backend.html
Normal file
58
consoles/haproxy-backend.html
Normal file
|
@ -0,0 +1,58 @@
|
|||
{{ 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(rate(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(rate(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(rate(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(rate(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(rate(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(rate(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)(rate(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" }}
|
29
consoles/haproxy-backends.html
Normal file
29
consoles/haproxy-backends.html
Normal file
|
@ -0,0 +1,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" }}
|
45
consoles/haproxy-frontend.html
Normal file
45
consoles/haproxy-frontend.html
Normal file
|
@ -0,0 +1,45 @@
|
|||
{{ 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(rate(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(rate(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(rate(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(rate(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)(rate(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" }}
|
25
consoles/haproxy-frontends.html
Normal file
25
consoles/haproxy-frontends.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
{{ 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)(rate(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" }}
|
84
consoles/haproxy.html
Normal file
84
consoles/haproxy.html
Normal file
|
@ -0,0 +1,84 @@
|
|||
{{ 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)(rate(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(rate(haproxy_frontend_http_requests_total{job='haproxy'}[5m]))" "/s" "humanizeNoSmallPrefix") }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Requests Denied</td>
|
||||
<td>{{ template "prom_query_drilldown" (args "sum(rate(haproxy_frontend_requests_denied_total{job='haproxy'}[5m]))" "/s" "humanizeNoSmallPrefix") }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Data In</td>
|
||||
<td>{{ template "prom_query_drilldown" (args "sum(rate(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(rate(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)(rate(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)(rate(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" }}
|
|
@ -6,6 +6,27 @@
|
|||
{{ template "prom_content_head" . }}
|
||||
<h1>Overview</h1>
|
||||
<p>These are example consoles for Prometheus, they are still under development.</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%">
|
||||
<tr>
|
||||
<th>Exporter</th>
|
||||
<th>Job label</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Node Exporter</td>
|
||||
<td><code>node</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>
|
||||
</table>
|
||||
|
||||
{{ template "prom_content_tail" . }}
|
||||
|
||||
{{ template "tail" }}
|
||||
|
|
Loading…
Reference in a new issue