Base SQL metrics in MetricsWorker (#2002)
* feat: Add metrics worker * refactor: Add todos for useful for metrics methods * feat: Run MetricsWorker is Prometheus is Enabled * refactor: Unused low-level variable was removed in metrics * feat: No worker for metrics, add more * refactor: Unnecessary todo removed * refactor: Remove dead unused constant * Reduce metrics public interface Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/navidrome/navidrome/conf"
|
||||
"github.com/navidrome/navidrome/consts"
|
||||
"github.com/navidrome/navidrome/core"
|
||||
"github.com/navidrome/navidrome/db"
|
||||
"github.com/navidrome/navidrome/log"
|
||||
"github.com/navidrome/navidrome/resources"
|
||||
@@ -91,6 +92,8 @@ func startServer(ctx context.Context) func() error {
|
||||
a.MountRouter("ListenBrainz Auth", consts.URLPathNativeAPI+"/listenbrainz", CreateListenBrainzRouter())
|
||||
}
|
||||
if conf.Server.Prometheus.Enabled {
|
||||
// blocking call because takes <1ms but useful if fails
|
||||
core.WriteInitialMetrics()
|
||||
a.MountRouter("Prometheus metrics", conf.Server.Prometheus.MetricsPath, promhttp.Handler())
|
||||
}
|
||||
if strings.HasPrefix(conf.Server.UILoginBackgroundURL, "/") {
|
||||
|
||||
Reference in New Issue
Block a user