mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 22:37:27 -08:00
StatusHandler renders build info
This commit is contained in:
parent
033533c4c5
commit
a2a4f94aae
|
@ -28,4 +28,5 @@ type ApplicationState struct {
|
|||
RuleManager rules.RuleManager
|
||||
Storage metric.Storage
|
||||
TargetManager retrieval.TargetManager
|
||||
BuildInfo map[string]string
|
||||
}
|
||||
|
|
1
main.go
1
main.go
|
@ -91,6 +91,7 @@ func main() {
|
|||
RuleManager: ruleManager,
|
||||
Storage: ts,
|
||||
TargetManager: targetManager,
|
||||
BuildInfo: BuildInfo,
|
||||
}
|
||||
|
||||
web.StartServing(appState)
|
||||
|
|
|
@ -24,6 +24,7 @@ type PrometheusStatus struct {
|
|||
Rules string
|
||||
Status string
|
||||
TargetPools map[string]*retrieval.TargetPool
|
||||
BuildInfo map[string]string
|
||||
}
|
||||
|
||||
type StatusHandler struct {
|
||||
|
@ -36,6 +37,7 @@ func (h *StatusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
Rules: "TODO: list rules here",
|
||||
Status: "TODO: add status information here",
|
||||
TargetPools: h.appState.TargetManager.Pools(),
|
||||
BuildInfo: h.appState.BuildInfo,
|
||||
}
|
||||
executeTemplate(w, "status", status)
|
||||
}
|
||||
|
|
|
@ -2,23 +2,23 @@
|
|||
|
||||
{{define "content"}}
|
||||
<h2>Status</h2>
|
||||
<div class="grouping_box">
|
||||
<div class="grouping_box">
|
||||
{{.Status}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Configuration</h2>
|
||||
<div class="grouping_box">
|
||||
<pre>
|
||||
<h2>Configuration</h2>
|
||||
<div class="grouping_box">
|
||||
<pre>
|
||||
{{.Config}}
|
||||
</pre>
|
||||
</div>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>Rules</h2>
|
||||
<div class="grouping_box">
|
||||
<div class="grouping_box">
|
||||
{{.Rules}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Targets</h2>
|
||||
<h2>Targets</h2>
|
||||
<div class="grouping_box">
|
||||
<ul>
|
||||
{{range $job, $pool := .TargetPools}}
|
||||
|
@ -33,5 +33,17 @@
|
|||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Build Info</h2>
|
||||
<div class="grouping_box">
|
||||
<table>
|
||||
{{range $key, $value := .BuildInfo}}
|
||||
<tr>
|
||||
<th scope="row">{{$key}}</th>
|
||||
<td>{{$value}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</table>
|
||||
</div>
|
||||
{{end}}
|
||||
|
|
Loading…
Reference in a new issue