Fix typo in the healthy metric (#657)
This commit is contained in:
parent
bed7ab9564
commit
941c0acea3
@ -230,7 +230,7 @@ func startServer() {
|
|||||||
|
|
||||||
fmt.Println("Starting server...")
|
fmt.Println("Starting server...")
|
||||||
go func() {
|
go func() {
|
||||||
metrics.SetHealty(true)
|
metrics.SetHealthy(true)
|
||||||
|
|
||||||
err := router.Run(fmt.Sprintf("%v:%v", options.HTTPHost, options.HTTPPort))
|
err := router.Run(fmt.Sprintf("%v:%v", options.HTTPHost, options.HTTPPort))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -16,8 +16,8 @@ var (
|
|||||||
Help: "Total number of custom queries executed",
|
Help: "Total number of custom queries executed",
|
||||||
})
|
})
|
||||||
|
|
||||||
healtyGauge = promauto.NewGauge(prometheus.GaugeOpts{
|
healthyGauge = promauto.NewGauge(prometheus.GaugeOpts{
|
||||||
Name: "pgweb_healty",
|
Name: "pgweb_healthy",
|
||||||
Help: "Server health status",
|
Help: "Server health status",
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@ -30,10 +30,10 @@ func SetSessionsCount(val int) {
|
|||||||
sessionsGauge.Set(float64(val))
|
sessionsGauge.Set(float64(val))
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetHealty(val bool) {
|
func SetHealthy(val bool) {
|
||||||
healthy := 0.0
|
healthy := 0.0
|
||||||
if val {
|
if val {
|
||||||
healthy = 1.0
|
healthy = 1.0
|
||||||
}
|
}
|
||||||
healtyGauge.Set(float64(healthy))
|
healthyGauge.Set(float64(healthy))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user