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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
|
<!DOCTYPE html>
{{/*
Copyright 2014 The Prometheus Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Prometheus Pushgateway</title>
{{- $prefix := index .Flags "web.route-prefix" }}
<script src="{{$prefix}}/static/jquery/jquery.min.js"></script>
<link rel="stylesheet" href="{{$prefix}}/static/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="{{$prefix}}/static/bootstrap/css/bootstrap-theme.min.css">
<script src="{{$prefix}}/static/bootstrap/js/bootstrap.min.js"></script>
<script src="{{$prefix}}/static/functions.js"></script>
<style type="text/css">
.cursor-pointer {
cursor: pointer;
}
</style>
</head>
<body>
<nav class="navbar navbar-inverse" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Pushgateway</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<ul class="nav navbar-nav">
<li onclick="pushgateway.switchToMetrics()"
id="metrics-li" class="active">
<a href="#">Metrics</a>
</li>
<li onclick="pushgateway.switchToStatus()"
id="status-li">
<a href="#">Status</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid" id="metrics-div">
{{$data := .}}
<div class="panel-group" id="job-accordion">
{{range .MetricGroups}}
{{$gCount := $data.Count}}
<div class="panel panel-default" id="group-panel-{{$gCount}}">
<div class="panel-heading cursor-pointer" data-toggle="collapse" data-parent="#job-accordion" data-target="#j-{{$gCount}}">
<h4 class="panel-title">
<span class="caret"></span>
{{$metricGroup := .}}
{{range $i, $ln := .SortedLabels}}
<span class="label {{if eq $ln "job"}}label-warning{{else if eq $ln "instance"}}label-primary{{else}}label-info{{end}}">{{$ln}}="{{index $metricGroup.Labels $ln}}"</span>
{{end}}
<button class="btn btn-xs btn-danger pull-right" onclick="pushgateway.showDelModal({ {{range $i, $ln := .SortedLabels}}{{if $i}}, {{end}}'{{$ln}}': '{{index $metricGroup.Labels $ln}}'{{end}} }, 'group-panel-{{$gCount}}', event)">Delete Group</button>
</h4>
</div>
<div id="j-{{$gCount}}" class="panel-collapse collapse">
<div class="panel-body">
<div class="panel-group" id="metric-accordion-{{$gCount}}">
{{range $name, $tmf := .Metrics }}
{{$mCount := $data.Count}}
<div class="panel panel-default">
<div class="panel-heading cursor-pointer" data-toggle="collapse" data-parent="#metric-accordion-{{$gCount}}" data-target="#m-{{$mCount}}">
<h4 class="panel-title">
<span class="caret"></span>
{{$name}}
<span class="badge">{{$tmf.GetMetricFamily.GetHelp}}</span>
<span class="label label-success">{{$tmf.GetMetricFamily.GetType}}</span>
last pushed: {{$tmf.Timestamp}}
</h4>
</div>
<div id="m-{{$mCount}}" class="panel-collapse collapse">
<div class="panel-body">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Labels</th>
<th>Value</th>
<th>Timestamp</th>
</tr>
</thead>
<tbody>
{{range $tmf.GetMetricFamily.Metric}}
<tr>
<td>
{{range .Label}}
<span class="label {{if eq .GetName "job"}}label-warning{{else if eq .GetName "instance"}}label-primary{{else}}label-info{{end}}">{{.Name}}="{{.GetValue}}"</span>
{{end}}
</td>
<td>
{{with .Gauge}}
{{value .GetValue}}
{{else}}
{{with .Counter}}
{{value .GetValue}}
{{else}}
{{with .Untyped}}
{{value .GetValue}}
{{else}}
{{with .Summary}}
<table class="table table-striped table-bordered table-hover">
{{range .Quantile}}
<tr>
<th scope="row">Quantile {{.GetQuantile}}</th>
<td>{{value .GetValue}}</td>
</tr>
{{end}}
<tr>
<th scope="row">Sample Count</th>
<td>{{.GetSampleCount}}</td>
</tr>
<tr>
<th scope="row">Sample Sum</th>
<td>{{value .GetSampleSum}}</td>
</tr>
</table>
{{else}}
{{with .Histogram}}
<table class="table table-striped table-bordered table-hover">
{{range .Bucket}}
<tr>
<th scope="row">Sample values ≤ {{value .GetUpperBound}}</th>
<td>{{.GetCumulativeCount}}</td>
</tr>
{{end}}
<tr>
<th scope="row">Total sample Count</th>
<td>{{.GetSampleCount}}</td>
</tr>
<tr>
<th scope="row">Sample Sum</th>
<td>{{value .GetSampleSum}}</td>
</tr>
</table>
{{end}}
{{end}}
{{end}}
{{end}}
{{end}}
</td>
<td>
{{if .TimestampMs}}
{{$t := .TimestampMs | $data.FormatTimestamp}}{{$t}} {{/* Indirection via $t needed. Bug in template/html? */}}
{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</div>
</div>
{{end}}
</div>
</div>
</div>
</div>
{{end}}
</div>
</div>
<div class="container-fluid hidden" id="status-div">
<h2>Runtime Information</h2>
<table class="table table-condensed table-bordered table-striped table-hover">
<tbody>
<tr>
<th>Started</th>
<td>{{.Birth}}</td>
</tr>
</tbody>
</table>
<h2>Build Information</h2>
<table class="table table-condensed table-bordered table-striped table-hover">
<tbody>
{{range $key, $value := .BuildInfo}}
<tr>
<th scope="row">{{$key}}</th>
<td>{{$value}}</td>
</tr>
{{end}}
</tbody>
</table>
<h2>Startup Flags</h2>
<table class="table table-condensed table-bordered table-striped table-hover">
<tbody>
{{range $key, $value := .Flags}}
<tr>
<th scope="row">{{$key}}</th>
<td>{{$value}}</td>
</tr>
{{end}}
</tbody>
</table>
</div>
<div class="container-fluid">
<hr class="clear-top">
<footer>
<p>
<a href="https://github.com/prometheus/pushgateway">Code</a>
<a href="https://prometheus.io/community/">Community</a>
© Prometheus Authors 2014
</p>
</footer>
</div>
<!-- del modal -->
<div id="del-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="del-header" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 id="del-header">Deletion Confirmation</h3>
</div>
<div class="modal-body">
<p id="del-modal-msg"><!-- To be filled dynamically. --></p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Cancel</button>
<button class="btn btn-primary btn-danger" onclick="pushgateway.deleteGroup()">Delete</button>
</div>
</div>
</div>
</div>
</body>
</html>
|