in single user mode provide full set of metrics

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-11-17 19:39:05 +03:00
parent 4ae2793781
commit 82824cdfcc

View File

@ -45,10 +45,12 @@ func main() {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill) ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill)
defer stop() defer stop()
m := victoriametrics.NewMeter( mopts := []meter.Option{
victoriametrics.PrometheusCompat(true), victoriametrics.PrometheusCompat(true),
// meter.WriteFDMetrics(true), }
// meter.WriteProcessMetrics(true),
m := victoriametrics.NewMeter(
mopts...,
) )
l := slog.NewLogger(logger.WithMeter(m)) l := slog.NewLogger(logger.WithMeter(m))
@ -71,6 +73,13 @@ func main() {
l.Fatal(ctx, "failed to open config", err) l.Fatal(ctx, "failed to open config", err)
} }
if !cfg.App.MultiUser {
m.Init(
meter.WriteFDMetrics(true),
meter.WriteProcessMetrics(true),
)
}
l.Info(ctx, "scheduler: create") l.Info(ctx, "scheduler: create")
sch, err := scheduler.NewScheduler() sch, err := scheduler.NewScheduler()
if err != nil { if err != nil {