aboutsummaryrefslogtreecommitdiff
path: root/weed/server/filer_server.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-06-14 00:54:56 -0700
committerChris Lu <chris.lu@gmail.com>2019-06-14 00:54:56 -0700
commit5f6c9825f8032ae34c64b3459f9ff2aff0c5efcd (patch)
tree389ec4acad783fbcc65fa1d192a20e38cae68773 /weed/server/filer_server.go
parenta11525fe4eb501f4c98db6aaf40800edabf30d08 (diff)
downloadseaweedfs-5f6c9825f8032ae34c64b3459f9ff2aff0c5efcd.tar.xz
seaweedfs-5f6c9825f8032ae34c64b3459f9ff2aff0c5efcd.zip
volume server: adds basic metrics
Diffstat (limited to 'weed/server/filer_server.go')
-rw-r--r--weed/server/filer_server.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go
index 0046035b0..9cd425981 100644
--- a/weed/server/filer_server.go
+++ b/weed/server/filer_server.go
@@ -88,23 +88,23 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
readonlyMux.HandleFunc("/", fs.readonlyFilerHandler)
}
- startPushingMetric(option.MetricsAddress, option.MetricsIntervalSec)
+ startPushingMetric("filer", filerGather, option.MetricsAddress, option.MetricsIntervalSec)
return fs, nil
}
-func startPushingMetric(addr string, intervalSeconds int) {
+func startPushingMetric(name string, gatherer *prometheus.Registry, addr string, intervalSeconds int) {
if intervalSeconds == 0 || addr == "" {
glog.V(0).Info("disable metrics reporting")
return
}
glog.V(0).Infof("push metrics to %s every %d seconds", addr, intervalSeconds)
- go loopPushMetrics(addr, intervalSeconds)
+ go loopPushMetrics(name, gatherer, addr, intervalSeconds)
}
-func loopPushMetrics(addr string, intervalSeconds int) {
+func loopPushMetrics(name string, gatherer *prometheus.Registry, addr string, intervalSeconds int) {
- pusher := push.New(addr, "filer").Gatherer(prometheus.DefaultGatherer)
+ pusher := push.New(addr, name).Gatherer(gatherer)
for {
err := pusher.Push()