add start metrics server

This commit is contained in:
Konstantin Lebedev
2020-09-24 17:45:39 +05:00
parent 3e52329cee
commit 324e44d4b3
7 changed files with 33 additions and 8 deletions

View File

@@ -54,6 +54,7 @@ type FilerOption struct {
recursiveDelete bool
Cipher bool
Filers []string
MetricsHttpPort int
}
type FilerServer struct {
@@ -157,6 +158,7 @@ func (fs *FilerServer) maybeStartMetrics() {
}
}
go stats.StartMetricsServer(stats.FilerGather, fs.option.MetricsHttpPort)
go stats.LoopPushingMetric("filer", stats.SourceName(fs.option.Port), stats.FilerGather, fs.metricsAddress, fs.metricsIntervalSec)
}

View File

@@ -46,6 +46,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
readRedirect bool,
compactionMBPerSecond int,
fileSizeLimitMB int,
metricsHttpPort int,
) *VolumeServer {
v := util.GetViper()
@@ -97,6 +98,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
}
go vs.heartbeat()
go stats.StartMetricsServer(stats.VolumeServerGather, metricsHttpPort)
go stats.LoopPushingMetric("volumeServer", fmt.Sprintf("%s:%d", ip, port), stats.VolumeServerGather, vs.metricsAddress, vs.metricsIntervalSec)
return vs