Skip to content

Commit

Permalink
Register all pending metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
aalda committed Apr 5, 2019
1 parent 4adc086 commit 5bf1c05
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,6 @@ func NewServer(conf *Config) (*Server, error) {
return nil, err
}

// create metrics server and register default qed metrics
server.metrics = newServerMetrics()
server.metricsServer = metrics.NewServer(conf.MetricsAddr)
server.RegisterMetrics(server.metricsServer)
store.RegisterMetrics(server.metricsServer)
// server.metricsServer.Register(raft.PrometheusCollectors())
// server.metricsServer.Register(balloon.PrometheusCollectors())

// Create gossip agent
config := gossip.DefaultConfig()
config.BindAddr = conf.GossipAddr
Expand Down Expand Up @@ -172,6 +164,13 @@ func NewServer(conf *Config) (*Server, error) {
mgmtMux := mgmthttp.NewMgmtHttp(server.raftBalloon)
server.mgmtServer = newHTTPServer(conf.MgmtAddr, mgmtMux)

// create metrics server and register qed metrics
server.metrics = newServerMetrics()
server.metricsServer = metrics.NewServer(conf.MetricsAddr)
server.RegisterMetrics(server.metricsServer)
store.RegisterMetrics(server.metricsServer)
raftBalloon.RegiterMetrics(server.metricsServer)

return server, nil
}

Expand Down Expand Up @@ -308,7 +307,6 @@ func (s *Server) Stop() error {
func (s *Server) RegisterMetrics(registry metrics.Registry) {
if registry != nil {
registry.MustRegister(s.metrics.collectors()...)
registry.MustRegister(metrics.DefaultMetrics...) // TODO: remove this!!!
}
}

Expand Down

0 comments on commit 5bf1c05

Please sign in to comment.