created docker-prometheus compose file and edited the Prometheus yml file
This commit is contained in:
53
prom/web/blob/templates/alerts.html
Normal file
53
prom/web/blob/templates/alerts.html
Normal file
@ -0,0 +1,53 @@
|
||||
{{define "head"}}
|
||||
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/static/css/alerts.css">
|
||||
<script src="{{ pathPrefix }}/static/js/alerts.js"></script>
|
||||
{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<div class="container-fluid">
|
||||
<h2>Alerts</h2>
|
||||
<table class="table table-bordered table-collapsed">
|
||||
<tbody>
|
||||
{{$alertStateToRowClass := .AlertStateToRowClass}}
|
||||
{{range .AlertingRules}}
|
||||
{{$activeAlerts := .ActiveAlerts}}
|
||||
<tr class="{{index $alertStateToRowClass .State}} alert_header">
|
||||
<td><i class="icon-chevron-down"></i> <b>{{.Name}}</b> ({{len $activeAlerts}} active)</td>
|
||||
</tr>
|
||||
<tr class="alert_details">
|
||||
<td>
|
||||
<div>
|
||||
<pre><code>{{.HTMLSnippet pathPrefix}}</code></pre>
|
||||
<a href="#" class="silence_children_link">Silence all instances of this alert…</a>
|
||||
</div>
|
||||
{{if $activeAlerts}}
|
||||
<table class="table table-bordered table-hover table-condensed alert_elements_table">
|
||||
<tr class="">
|
||||
<th>Labels</th>
|
||||
<th>State</th>
|
||||
<th>Active Since</th>
|
||||
<th>Value</th>
|
||||
<th>Silence</th>
|
||||
</tr>
|
||||
{{range $activeAlerts}}
|
||||
<tr>
|
||||
<td>
|
||||
{{range $label, $value := .Labels}}
|
||||
<span class="label label-primary">{{$label}}="{{$value}}"</span>
|
||||
{{end}}
|
||||
</td>
|
||||
<td><span class="alert alert-{{ .State | alertStateToClass }} state_indicator text-uppercase">{{.State}}</span></td>
|
||||
<td>{{.ActiveSince.Time.UTC}}</td>
|
||||
<td>{{.Value}}</td>
|
||||
<td><a href="#" class="silence_alert_link">Silence…</a></td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</table>
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{end}}
|
30
prom/web/blob/templates/graph.html
Normal file
30
prom/web/blob/templates/graph.html
Normal file
@ -0,0 +1,30 @@
|
||||
{{define "head"}}
|
||||
<script src="{{ pathPrefix }}/static/vendor/bootstrap-3.3.1/js/bootstrap.min.js"></script>
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/static/css/graph.css">
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/static/vendor/rickshaw/rickshaw.min.css">
|
||||
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/static/vendor/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css">
|
||||
|
||||
<script src="{{ pathPrefix }}/static/vendor/rickshaw/vendor/d3.v3.js"></script>
|
||||
<script src="{{ pathPrefix }}/static/vendor/rickshaw/vendor/d3.layout.min.js"></script>
|
||||
<script src="{{ pathPrefix }}/static/vendor/rickshaw/rickshaw.min.js"></script>
|
||||
<script src="{{ pathPrefix }}/static/vendor/bootstrap-datetimepicker/bootstrap-datetimepicker.js"></script>
|
||||
<script src="{{ pathPrefix }}/static/vendor/bootstrap3-typeahead/bootstrap3-typeahead.min.js"></script>
|
||||
|
||||
<script src="{{ pathPrefix }}/static/vendor/js/handlebars.js"></script>
|
||||
<script src="{{ pathPrefix }}/static/vendor/js/jquery.selection.js"></script>
|
||||
<script src="{{ pathPrefix }}/static/vendor/js/jquery.hotkeys.js"></script>
|
||||
|
||||
<script src="{{ pathPrefix }}/static/js/graph.js"></script>
|
||||
|
||||
<script id="graph_template" type="text/x-handlebars-template"></script>
|
||||
{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<div id="graph_container" class="container-fluid">
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div><input class="btn btn-primary" type="submit" value="Add Graph" id="add_graph"></div>
|
||||
</div>
|
||||
{{end}}
|
100
prom/web/blob/templates/status.html
Normal file
100
prom/web/blob/templates/status.html
Normal file
@ -0,0 +1,100 @@
|
||||
{{define "head"}}<!-- nix -->{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<div class="container-fluid">
|
||||
<h2 id="runtime">Runtime Information</h2>
|
||||
<table class="table table-condensed table-bordered table-striped table-hover">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Uptime</th>
|
||||
<td>{{.Status.Birth.UTC}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2 id="buildinformation">Build Information</h2>
|
||||
<table class="table table-condensed table-bordered table-striped table-hover">
|
||||
<tbody>
|
||||
{{range $key, $value := .Info}}
|
||||
<tr>
|
||||
<th scope="row">{{$key}}</th>
|
||||
<td>{{$value}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2 id="configuration">Configuration</h2>
|
||||
<pre>{{.Status.Config}}</pre>
|
||||
|
||||
<h2 id="rules">Rules</h2>
|
||||
<pre>{{range call .Status.Rules}}{{.HTMLSnippet pathPrefix}}<br/>{{end}}</pre>
|
||||
|
||||
<h2 id="targets">Targets</h2>
|
||||
<table class="table table-condensed table-bordered table-striped table-hover">
|
||||
{{range $job, $pool := call .Status.TargetPools}}
|
||||
<thead>
|
||||
<tr><th colspan="5" class="job_header">{{$job}}</th></tr>
|
||||
<tr>
|
||||
<th>Endpoint</th>
|
||||
<th>State</th>
|
||||
<th>Base Labels</th>
|
||||
<th>Last Scrape</th>
|
||||
<th>Error</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range $pool}}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{.URL | globalURL}}">{{.URL.Scheme}}://{{.URL.Host}}{{.URL.Path}}</a><br>
|
||||
{{range $label, $values := .URL.Query }}
|
||||
{{range $i, $value := $values}}
|
||||
<span class="label label-primary">{{$label}}="{{$value}}"</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</td>
|
||||
<td>
|
||||
<span class="alert alert-{{ .Status.Health | healthToClass }} state_indicator text-uppercase">
|
||||
{{.Status.Health}}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="cursor-pointer" data-toggle="tooltip" title="" data-original-title="Before relabeling: {{.MetaLabels}}">
|
||||
{{$baseLabels := stripLabels .BaseLabels "job" "instance"}}
|
||||
{{if $baseLabels}}
|
||||
{{range $label, $value := $baseLabels}}
|
||||
<span class="label label-primary">{{$label}}="{{$value}}"</span>
|
||||
{{end}}
|
||||
{{else}}
|
||||
<span class="label label-default">none</span>
|
||||
{{end}}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
{{if .Status.LastScrape.IsZero}}Never{{else}}{{since .Status.LastScrape}} ago{{end}}
|
||||
</td>
|
||||
<td>
|
||||
{{if .Status.LastError}}
|
||||
<span class="alert alert-danger state_indicator">{{.Status.LastError}}</span>
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
{{end}}
|
||||
</table>
|
||||
|
||||
<h2 id="startupflags">Startup Flags</h2>
|
||||
<table class="table table-condensed table-bordered table-striped table-hover">
|
||||
<tbody>
|
||||
{{range $key, $value := .Status.Flags}}
|
||||
<tr>
|
||||
<th scope="row">{{$key}}</th>
|
||||
<td>{{$value}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{end}}
|
Reference in New Issue
Block a user