[#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

View file

@ -299,7 +299,7 @@ func initObjectService(c *cfg) {
)
// build service pipeline
// grpc | acl | signature | response | split
// grpc | <metrics> | acl | signature | response | split
splitSvc := objectService.NewTransportSplitter(
c.cfgGRPC.maxChunkSize,
@ -344,8 +344,13 @@ func initObjectService(c *cfg) {
acl.WithNetmapState(c.cfgNetmap.state),
)
var firstSvc objectService.ServiceServer = aclSvc
if c.viper.GetBool(cfgMetricsEnable) {
firstSvc = objectService.NewMetricCollector(aclSvc)
}
objectGRPC.RegisterObjectServiceServer(c.cfgGRPC.server,
objectTransportGRPC.New(aclSvc),
objectTransportGRPC.New(firstSvc),
)
}