lengyuexuexuan commented on code in PR #2285:
URL: 
https://github.com/apache/incubator-pegasus/pull/2285#discussion_r2296988309


##########
go-client/pegasus/client.go:
##########
@@ -59,17 +63,25 @@ func NewClient(cfg Config) Client {
        return c
 }
 
-func newClientWithError(cfg Config) (Client, error) {
+func newClientWithError(cfg config.Config) (Client, error) {
        var err error
        cfg.MetaServers, err = session.ResolveMetaAddr(cfg.MetaServers)
        if err != nil {
                return nil, err
        }
 
+       if cfg.EnablePrometheus || cfg.EnableFalcon {
+               metrics.InitMetrics(prometheus.DefaultRegisterer, cfg)
+               if cfg.EnableFalcon {
+                       go metrics.GetFalconReporter(cfg.FalconServer, 
cfg.FalconInterval).Start()
+               }
+       }

Review Comment:
   No matter whether Prometheus or Falcon is used, EnablePrometheus must be 
true.
   If cfg.EnableFalcon = true while cfg.EnablePrometheus = false, it may cause 
problems.
   Therefore, an error message should be logged in this case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to