sijie commented on a change in pull request #6105: [pulsar-function-go] Add 
statistics and Prometheus to Go Function instances for production readiness
URL: https://github.com/apache/pulsar/pull/6105#discussion_r406389658
 
 

 ##########
 File path: pulsar-function-go/pf/instance.go
 ##########
 @@ -128,20 +146,27 @@ CLOSE:
                        if autoAck && atMostOnce {
                                gi.ackInputMessage(msgInput)
                        }
-
+                       gi.stats.incrTotalReceived()
                        gi.addLogTopicHandler()
 
+                       gi.stats.setLastInvocation()
+                       gi.stats.processTimeStart()
+
                        output, err := gi.handlerMsg(msgInput)
                        if err != nil {
                                log.Errorf("handler message error:%v", err)
                                if autoAck && atLeastOnce {
                                        gi.nackInputMessage(msgInput)
                                }
+                               gi.stats.incrTotalUserExceptions(err)
                                return err
                        }
 
                        gi.processResult(msgInput, output)
 
+                       gi.stats.processTimeEnd() // Should this be called here 
or before processResult(..)?
 
 Review comment:
   I think this should be called before `processResult`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to