forked from TrueCloudLab/frostfs-node
[#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:
parent
534ce03421
commit
3c0e47e6fd
4 changed files with 34 additions and 2 deletions
|
@ -58,6 +58,10 @@ const (
|
|||
cfgProfilerAddr = "pprof.address"
|
||||
cfgProfilerTTL = "pprof.shutdown_ttl"
|
||||
|
||||
// metrics keys
|
||||
cfgMetricsEnable = "metrics.enabled"
|
||||
cfgMetricsAddr = "metrics.address"
|
||||
|
||||
// config keys for cfgNodeInfo
|
||||
cfgNodeKey = "node.key"
|
||||
cfgBootstrapAddress = "node.address"
|
||||
|
@ -180,6 +184,8 @@ type cfg struct {
|
|||
|
||||
profiler profiler.Profiler
|
||||
|
||||
metrics profiler.Metrics
|
||||
|
||||
workers []worker
|
||||
|
||||
respSvc *response.Service
|
||||
|
@ -414,6 +420,9 @@ func defaultConfiguration(v *viper.Viper) {
|
|||
v.SetDefault(cfgProfilerAddr, ":6060")
|
||||
v.SetDefault(cfgProfilerTTL, "30s")
|
||||
|
||||
v.SetDefault(cfgMetricsEnable, false)
|
||||
v.SetDefault(cfgMetricsAddr, ":9090")
|
||||
|
||||
v.SetDefault(cfgGCQueueSize, 1000)
|
||||
v.SetDefault(cfgGCQueueTick, "5s")
|
||||
v.SetDefault(cfgGCTimeout, "5s")
|
||||
|
@ -448,6 +457,7 @@ func initLocalStorage(c *cfg) {
|
|||
|
||||
ls := engine.New(
|
||||
engine.WithLogger(c.log),
|
||||
engine.WithMetrics(c.viper.GetBool(cfgMetricsEnable)),
|
||||
)
|
||||
|
||||
for _, opts := range c.cfgObject.cfgLocalStorage.shardOpts {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue