Fix typo in the healthy metric (#657)

This commit is contained in:
Dan Sosedoff 2023-02-28 11:57:36 -06:00 committed by GitHub
parent bed7ab9564
commit 941c0acea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -230,7 +230,7 @@ func startServer() {
fmt.Println("Starting server...")
go func() {
metrics.SetHealty(true)
metrics.SetHealthy(true)
err := router.Run(fmt.Sprintf("%v:%v", options.HTTPHost, options.HTTPPort))
if err != nil {

View File

@ -16,8 +16,8 @@ var (
Help: "Total number of custom queries executed",
})
healtyGauge = promauto.NewGauge(prometheus.GaugeOpts{
Name: "pgweb_healty",
healthyGauge = promauto.NewGauge(prometheus.GaugeOpts{
Name: "pgweb_healthy",
Help: "Server health status",
})
)
@ -30,10 +30,10 @@ func SetSessionsCount(val int) {
sessionsGauge.Set(float64(val))
}
func SetHealty(val bool) {
func SetHealthy(val bool) {
healthy := 0.0
if val {
healthy = 1.0
}
healtyGauge.Set(float64(healthy))
healthyGauge.Set(float64(healthy))
}