mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #2602 from kmlebedev/master_metrics
master metricsHttpPort
This commit is contained in:
commit
7c66f3b5fb
|
@ -2,6 +2,7 @@ package command
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/chrislusf/raft/protobuf"
|
"github.com/chrislusf/raft/protobuf"
|
||||||
|
stats_collect "github.com/chrislusf/seaweedfs/weed/stats"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"google.golang.org/grpc/reflection"
|
"google.golang.org/grpc/reflection"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -42,6 +43,7 @@ type MasterOptions struct {
|
||||||
metricsAddress *string
|
metricsAddress *string
|
||||||
metricsIntervalSec *int
|
metricsIntervalSec *int
|
||||||
raftResumeState *bool
|
raftResumeState *bool
|
||||||
|
metricsHttpPort *int
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -61,6 +63,7 @@ func init() {
|
||||||
m.disableHttp = cmdMaster.Flag.Bool("disableHttp", false, "disable http requests, only gRPC operations are allowed.")
|
m.disableHttp = cmdMaster.Flag.Bool("disableHttp", false, "disable http requests, only gRPC operations are allowed.")
|
||||||
m.metricsAddress = cmdMaster.Flag.String("metrics.address", "", "Prometheus gateway address <host>:<port>")
|
m.metricsAddress = cmdMaster.Flag.String("metrics.address", "", "Prometheus gateway address <host>:<port>")
|
||||||
m.metricsIntervalSec = cmdMaster.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds")
|
m.metricsIntervalSec = cmdMaster.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds")
|
||||||
|
m.metricsHttpPort = cmdMaster.Flag.Int("metricsPort", 0, "Prometheus metrics listen port")
|
||||||
m.raftResumeState = cmdMaster.Flag.Bool("resumeState", false, "resume previous state on start master server")
|
m.raftResumeState = cmdMaster.Flag.Bool("resumeState", false, "resume previous state on start master server")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +107,7 @@ func runMaster(cmd *Command, args []string) bool {
|
||||||
glog.Fatalf("volumeSizeLimitMB should be smaller than 30000")
|
glog.Fatalf("volumeSizeLimitMB should be smaller than 30000")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
go stats_collect.StartMetricsServer(*m.metricsHttpPort)
|
||||||
startMaster(m, masterWhiteList)
|
startMaster(m, masterWhiteList)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue