aboutsummaryrefslogtreecommitdiff
path: root/weed/command/s3.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command/s3.go')
-rw-r--r--weed/command/s3.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/weed/command/s3.go b/weed/command/s3.go
index a9b317138..3562dc765 100644
--- a/weed/command/s3.go
+++ b/weed/command/s3.go
@@ -23,12 +23,13 @@ var (
)
type S3Options struct {
- filer *string
- port *int
- config *string
- domainName *string
- tlsPrivateKey *string
- tlsCertificate *string
+ filer *string
+ port *int
+ config *string
+ domainName *string
+ tlsPrivateKey *string
+ tlsCertificate *string
+ metricsHttpPort *int
}
func init() {
@@ -39,6 +40,7 @@ func init() {
s3StandaloneOptions.config = cmdS3.Flag.String("config", "", "path to the config file")
s3StandaloneOptions.tlsPrivateKey = cmdS3.Flag.String("key.file", "", "path to the TLS private key file")
s3StandaloneOptions.tlsCertificate = cmdS3.Flag.String("cert.file", "", "path to the TLS certificate file")
+ s3StandaloneOptions.metricsHttpPort = cmdS3.Flag.Int("metricsPort", 0, "Prometheus metrics listen port")
}
var cmdS3 = &Command{
@@ -153,6 +155,7 @@ func (s3opt *S3Options) startS3Server() bool {
}
}
+ go stats_collect.StartMetricsServer(stats_collect.S3Gather, *s3opt.metricsHttpPort)
go stats_collect.LoopPushingMetric("s3", stats_collect.SourceName(uint32(*s3opt.port)), stats_collect.S3Gather, metricsAddress, metricsIntervalSec)
router := mux.NewRouter().SkipClean(true)
@@ -169,7 +172,6 @@ func (s3opt *S3Options) startS3Server() bool {
if s3ApiServer_err != nil {
glog.Fatalf("S3 API Server startup error: %v", s3ApiServer_err)
}
-
httpS := &http.Server{Handler: router}
listenAddress := fmt.Sprintf(":%d", *s3opt.port)