aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/server.go2
-rw-r--r--weed/command/volume.go6
2 files changed, 8 insertions, 0 deletions
diff --git a/weed/command/server.go b/weed/command/server.go
index 30618c452..f6c2b5036 100644
--- a/weed/command/server.go
+++ b/weed/command/server.go
@@ -149,6 +149,8 @@ func runServer(cmd *Command, args []string) bool {
filerOptions.metricsAddress = serverOptions.metricsAddress
filerOptions.metricsIntervalSec = serverOptions.metricsIntervalSec
+ serverOptions.v.metricsAddress = serverOptions.metricsAddress
+ serverOptions.v.metricsIntervalSec = serverOptions.metricsIntervalSec
filerAddress := fmt.Sprintf("%s:%d", *serverIp, *filerOptions.port)
s3Options.filer = &filerAddress
diff --git a/weed/command/volume.go b/weed/command/volume.go
index c775ac5cf..5726528d5 100644
--- a/weed/command/volume.go
+++ b/weed/command/volume.go
@@ -45,6 +45,8 @@ type VolumeServerOptions struct {
cpuProfile *string
memProfile *string
compactionMBPerSecond *int
+ metricsAddress *string
+ metricsIntervalSec *int
}
func init() {
@@ -66,6 +68,8 @@ func init() {
v.cpuProfile = cmdVolume.Flag.String("cpuprofile", "", "cpu profile output file")
v.memProfile = cmdVolume.Flag.String("memprofile", "", "memory profile output file")
v.compactionMBPerSecond = cmdVolume.Flag.Int("compactionMBps", 0, "limit background compaction or copying speed in mega bytes per second")
+ v.metricsAddress = cmdVolume.Flag.String("metrics.address", "", "Prometheus gateway address")
+ v.metricsIntervalSec = cmdVolume.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds")
}
var cmdVolume = &Command{
@@ -161,6 +165,8 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v
v.whiteList,
*v.fixJpgOrientation, *v.readRedirect,
*v.compactionMBPerSecond,
+ *v.metricsAddress,
+ *v.metricsIntervalSec,
)
listeningAddress := *v.bindIp + ":" + strconv.Itoa(*v.port)