[#426] cmd/neofs-node: Add metrics collector in node

Disabled by default.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-03-15 16:11:40 +03:00 committed by Leonard Lyubich
parent 534ce03421
commit 3c0e47e6fd
4 changed files with 34 additions and 2 deletions

15
cmd/neofs-node/metrics.go Normal file
View file

@ -0,0 +1,15 @@
package main
import (
"github.com/nspcc-dev/neofs-node/pkg/util/profiler"
)
func initMetrics(c *cfg) {
c.metrics = profiler.NewMetrics(c.log, c.viper)
}
func serveMetrics(c *cfg) {
if c.metrics != nil {
c.metrics.Start(c.ctx)
}
}