Browse Source

Merge pull request #1195 from lyda/blackbox-console-squashed

Add blackbox console.
pull/1197/head
Brian Brazil 9 years ago
parent
commit
a2072d617d
  1. 4
      console_libraries/menu.lib
  2. 52
      consoles/blackbox.html
  3. 4
      consoles/index.html.example

4
console_libraries/menu.lib

@ -61,6 +61,10 @@
{{ 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 }}

52
consoles/blackbox.html

@ -0,0 +1,52 @@
{{ 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" }}

4
consoles/index.html.example

@ -37,6 +37,10 @@
<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" . }}

Loading…
Cancel
Save