From 82824cdfccb0ea6cc233138950944d3443d98675 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sun, 17 Nov 2024 19:39:05 +0300 Subject: [PATCH] in single user mode provide full set of metrics Signed-off-by: Vasiliy Tolstov --- cmd/servicechecker/main.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cmd/servicechecker/main.go b/cmd/servicechecker/main.go index e47b416..9be32d7 100644 --- a/cmd/servicechecker/main.go +++ b/cmd/servicechecker/main.go @@ -45,10 +45,12 @@ func main() { ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill) defer stop() - m := victoriametrics.NewMeter( + mopts := []meter.Option{ victoriametrics.PrometheusCompat(true), - // meter.WriteFDMetrics(true), - // meter.WriteProcessMetrics(true), + } + + m := victoriametrics.NewMeter( + mopts..., ) l := slog.NewLogger(logger.WithMeter(m)) @@ -71,6 +73,13 @@ func main() { 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") sch, err := scheduler.NewScheduler() if err != nil {