aboutsummaryrefslogtreecommitdiff
path: root/weed/command/s3.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2020-09-24 09:50:48 -0700
committerGitHub <noreply@github.com>2020-09-24 09:50:48 -0700
commit2e9099369e603308c703e4a78e48882ca3c5a5fc (patch)
tree67152aa22273e000ed0a35b2c91a9c01587aca08 /weed/command/s3.go
parent2e7c361a0d5fe1217bc00512d7ac7bc5975dfb53 (diff)
parent98e9de6e111a1e4512a9d78d7d44d949af14d6dc (diff)
downloadseaweedfs-2e9099369e603308c703e4a78e48882ca3c5a5fc.tar.xz
seaweedfs-2e9099369e603308c703e4a78e48882ca3c5a5fc.zip
Merge pull request #1489 from kmlebedev/promhttp
Promhttp
Diffstat (limited to 'weed/command/s3.go')
-rw-r--r--weed/command/s3.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/weed/command/s3.go b/weed/command/s3.go
index a9b317138..fb09731fa 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)