go version and deps update, fixed middlewares and metrics

- fixed "API JWT secret empty" warning output format
- fixed metrics initialized when it should not
- fixed middlewares.modifyRequest Host header not working properly
This commit is contained in:
yusing
2024-11-08 06:14:08 +08:00
parent 5214ae1760
commit f97e3f65fe
13 changed files with 101 additions and 78 deletions

View File

@@ -174,16 +174,16 @@ func (mon *monitor) checkUpdateHealth() error {
logger.Debug().Msg(detail)
notif.Notify(mon.service, "server is down")
}
if common.PrometheusEnabled {
go func() {
m := metrics.GetRouteMetrics()
var up float64
if healthy {
up = 1
}
m.HealthStatus.With(metrics.HealthMetricLabels(mon.service)).Set(up)
}()
}
}
if common.PrometheusEnabled {
go func() {
m := metrics.GetRouteMetrics()
var up float64
if healthy {
up = 1
}
m.HealthStatus.With(metrics.HealthMetricLabels(mon.service)).Set(up)
}()
}
return nil