mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-13 23:10:12 -08:00
Include uptime in the status console.
In order to help corroborate whether a Prometheus instance has flapped until meta-monitoring is in-place, we ought to provide the instance's start time in the console to aid in diagnostics.
This commit is contained in:
parent
c10780c966
commit
0d2d6e9a27
1
main.go
1
main.go
|
@ -224,6 +224,7 @@ func main() {
|
||||||
Config: conf.String(),
|
Config: conf.String(),
|
||||||
TargetPools: targetManager.Pools(),
|
TargetPools: targetManager.Pools(),
|
||||||
Flags: flags,
|
Flags: flags,
|
||||||
|
Birth: time.Now(),
|
||||||
},
|
},
|
||||||
CurationState: curationState,
|
CurationState: curationState,
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import (
|
||||||
"github.com/prometheus/prometheus/storage/metric"
|
"github.com/prometheus/prometheus/storage/metric"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PrometheusStatus struct {
|
type PrometheusStatus struct {
|
||||||
|
@ -27,6 +28,8 @@ type PrometheusStatus struct {
|
||||||
Flags map[string]string
|
Flags map[string]string
|
||||||
Rules string
|
Rules string
|
||||||
TargetPools map[string]*retrieval.TargetPool
|
TargetPools map[string]*retrieval.TargetPool
|
||||||
|
|
||||||
|
Birth time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
type StatusHandler struct {
|
type StatusHandler struct {
|
||||||
|
|
|
@ -1,7 +1,18 @@
|
||||||
{{define "head"}}<!-- nix -->{{end}}
|
{{define "head"}}<!-- nix -->{{end}}
|
||||||
|
|
||||||
{{define "content"}}
|
{{define "content"}}
|
||||||
<h2>Build Info</h2>
|
<h2>Runtime Information</h2>
|
||||||
|
<div class="grouping_box">
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Uptime</th>
|
||||||
|
<td>{{.Birth}}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<h2>Build Information</h2>
|
||||||
<div class="grouping_box">
|
<div class="grouping_box">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
Loading…
Reference in a new issue