diff options
Diffstat (limited to 'weed/command/server.go')
| -rw-r--r-- | weed/command/server.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/weed/command/server.go b/weed/command/server.go index 437b0ad83..30618c452 100644 --- a/weed/command/server.go +++ b/weed/command/server.go @@ -24,8 +24,10 @@ import ( ) type ServerOptions struct { - cpuprofile *string - v VolumeServerOptions + cpuprofile *string + metricsAddress *string + metricsIntervalSec *int + v VolumeServerOptions } var ( @@ -81,6 +83,8 @@ var ( func init() { serverOptions.cpuprofile = cmdServer.Flag.String("cpuprofile", "", "cpu profile output file") + serverOptions.metricsAddress = cmdServer.Flag.String("metrics.address", "", "Prometheus gateway address") + serverOptions.metricsIntervalSec = cmdServer.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds") filerOptions.collection = cmdServer.Flag.String("filer.collection", "", "all data will be stored in this collection") filerOptions.port = cmdServer.Flag.Int("filer.port", 8888, "filer server http listen port") filerOptions.publicPort = cmdServer.Flag.Int("filer.port.public", 0, "filer server public http listen port") @@ -143,6 +147,9 @@ func runServer(cmd *Command, args []string) bool { filerOptions.dataCenter = serverDataCenter filerOptions.disableHttp = serverDisableHttp + filerOptions.metricsAddress = serverOptions.metricsAddress + filerOptions.metricsIntervalSec = serverOptions.metricsIntervalSec + filerAddress := fmt.Sprintf("%s:%d", *serverIp, *filerOptions.port) s3Options.filer = &filerAddress |
