aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-06-13 02:01:51 -0700
committerChris Lu <chris.lu@gmail.com>2019-06-13 02:01:54 -0700
commita11525fe4eb501f4c98db6aaf40800edabf30d08 (patch)
tree402552f42955055eff7c09d06fbeb0a2a9d3389f /weed/command/filer.go
parentc542714448cff02e72ddc75f30712c24c3b3024f (diff)
downloadseaweedfs-a11525fe4eb501f4c98db6aaf40800edabf30d08.tar.xz
seaweedfs-a11525fe4eb501f4c98db6aaf40800edabf30d08.zip
filer: adds basic metrics pushing to Prometheus gateway
Diffstat (limited to 'weed/command/filer.go')
-rw-r--r--weed/command/filer.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go
index 2aa022cd0..83e9df20f 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -34,6 +34,8 @@ type FilerOptions struct {
dataCenter *string
enableNotification *bool
disableHttp *bool
+ metricsAddress *string
+ metricsIntervalSec *int
// default leveldb directory, used in "weed server" mode
defaultLevelDbDirectory *string
@@ -53,6 +55,8 @@ func init() {
f.dirListingLimit = cmdFiler.Flag.Int("dirListLimit", 100000, "limit sub dir listing size")
f.dataCenter = cmdFiler.Flag.String("dataCenter", "", "prefer to write to volumes in this data center")
f.disableHttp = cmdFiler.Flag.Bool("disableHttp", false, "disable http request, only gRpc operations are allowed")
+ f.metricsAddress = cmdFiler.Flag.String("metrics.address", "", "Prometheus gateway address")
+ f.metricsIntervalSec = cmdFiler.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds")
}
var cmdFiler = &Command{
@@ -110,6 +114,8 @@ func (fo *FilerOptions) startFiler() {
DataCenter: *fo.dataCenter,
DefaultLevelDbDir: defaultLevelDbDirectory,
DisableHttp: *fo.disableHttp,
+ MetricsAddress: *fo.metricsAddress,
+ MetricsIntervalSec: *fo.metricsIntervalSec,
})
if nfs_err != nil {
glog.Fatalf("Filer startup error: %v", nfs_err)