From 941c0acea3a6161c90664f26e2907fe5e992d0a3 Mon Sep 17 00:00:00 2001 From: Dan Sosedoff Date: Tue, 28 Feb 2023 11:57:36 -0600 Subject: [PATCH] Fix typo in the healthy metric (#657) --- pkg/cli/cli.go | 2 +- pkg/metrics/metrics.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index 9c61820..70493a2 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -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 { diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go index 43b9bf9..7b8b112 100644 --- a/pkg/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -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)) }