devinbost edited a comment on issue #7489:
URL: https://github.com/apache/pulsar/issues/7489#issuecomment-656182881


   It looks like the current design is leaking the metrics when exceptions are 
thrown. 
   @sijie @jerrypeng Based on feedback from the Prometheus maintainers, the way 
we're currently using the metrics for Java functions goes against their design 
recommendations. So, when I wrote the Prometheus implementation for the 
pulsar-function-go module, I implemented their recommended design instead, 
which avoids these issues. (It uses a stateless approach instead of the 
stateful approach that currently exists in our Java function Prometheus 
implementation.)
   
   We may need to do some refactoring to fix this issue, but the implementation 
that I used for Go functions may serve as a guide:
   https://github.com/apache/pulsar/blob/master/pulsar-function-go/pf/stats.go


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to