mirror of
https://github.com/prometheus/prometheus
synced 2025-01-01 12:02:13 +00:00
Merge pull request #583 from prometheus/nicer-target-health
Nicer formatting of target health table on /status.
This commit is contained in:
commit
a9cbcf442d
@ -10,7 +10,7 @@ th.job_header {
|
|||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error_text {
|
.target_status_alert {
|
||||||
padding: 0 4px 0 4px;
|
padding: 0 4px 0 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,14 @@ type PrometheusStatusHandler struct {
|
|||||||
Birth time.Time
|
Birth time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *PrometheusStatusHandler) TargetStateToClass() map[retrieval.TargetState]string {
|
||||||
|
return map[retrieval.TargetState]string{
|
||||||
|
retrieval.Unknown: "warning",
|
||||||
|
retrieval.Healthy: "success",
|
||||||
|
retrieval.Unhealthy: "danger",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (h *PrometheusStatusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (h *PrometheusStatusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
executeTemplate(w, "status", h)
|
executeTemplate(w, "status", h)
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,9 @@
|
|||||||
<pre>{{range .RuleManager.Rules}}{{.HTMLSnippet}}<br/>{{end}}</pre>
|
<pre>{{range .RuleManager.Rules}}{{.HTMLSnippet}}<br/>{{end}}</pre>
|
||||||
|
|
||||||
<h2>Targets</h2>
|
<h2>Targets</h2>
|
||||||
{{range $job, $pool := .TargetPools}}
|
<table class="table table-condensed table-bordered table-striped table-hover">
|
||||||
<table class="table table-condensed table-bordered table-striped table-hover">
|
{{$stateToClass := .TargetStateToClass}}
|
||||||
|
{{range $job, $pool := .TargetPools}}
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th colspan="5" class="job_header">{{$job}}</th></tr>
|
<tr><th colspan="5" class="job_header">{{$job}}</th></tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -50,7 +51,9 @@
|
|||||||
<a href="{{.GlobalURL}}">{{.URL}}</a>
|
<a href="{{.GlobalURL}}">{{.URL}}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{.State}}
|
<span class="alert alert-{{index $stateToClass .State}} target_status_alert">
|
||||||
|
{{.State}}
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{.BaseLabels}}
|
{{.BaseLabels}}
|
||||||
@ -60,14 +63,14 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{if .LastError}}
|
{{if .LastError}}
|
||||||
<span class="alert alert-error error_text">{{.LastError}}</span>
|
<span class="alert alert-danger target_status_alert">{{.LastError}}</span>
|
||||||
{{end}}
|
{{end}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{end}}
|
{{end}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
{{end}}
|
||||||
{{end}}
|
</table>
|
||||||
|
|
||||||
<h2>Startup Flags</h2>
|
<h2>Startup Flags</h2>
|
||||||
<table class="table table-condensed table-bordered table-striped table-hover">
|
<table class="table table-condensed table-bordered table-striped table-hover">
|
||||||
|
Loading…
Reference in New Issue
Block a user