aboutsummaryrefslogtreecommitdiff
path: root/weed/server
diff options
context:
space:
mode:
authorKonstantin Lebedev <lebedev_k@tochka.com>2020-09-24 17:45:39 +0500
committerKonstantin Lebedev <lebedev_k@tochka.com>2020-09-24 17:45:39 +0500
commit324e44d4b3dffc1197bf8f6c6ec49297ace44c2b (patch)
treeedf0b2b4d990e4085d58ab084270912fd9fb5e77 /weed/server
parent3e52329cee39f3a83f58d3896514547093ff0cf8 (diff)
downloadseaweedfs-324e44d4b3dffc1197bf8f6c6ec49297ace44c2b.tar.xz
seaweedfs-324e44d4b3dffc1197bf8f6c6ec49297ace44c2b.zip
add start metrics server
Diffstat (limited to 'weed/server')
-rw-r--r--weed/server/filer_server.go2
-rw-r--r--weed/server/volume_server.go2
2 files changed, 4 insertions, 0 deletions
diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go
index 4d6d424dc..de271a483 100644
--- a/weed/server/filer_server.go
+++ b/weed/server/filer_server.go
@@ -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)
}
diff --git a/weed/server/volume_server.go b/weed/server/volume_server.go
index 5e9ec1369..2a9097f01 100644
--- a/weed/server/volume_server.go
+++ b/weed/server/volume_server.go
@@ -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