flowchartsman opened a new issue #9772:
URL: https://github.com/apache/pulsar/issues/9772


   Currently Go function metrics are implemented with a Prometheus registry and 
[instantiated at runtime in an 
init()](https://github.com/apache/pulsar/blob/206ea82e012af34c5bb7f824826205019f3dd4ff/pulsar-function-go/pf/stats.go#L57-L150).
 These metrics are exposed to the functions runtime and automatically updated 
by the SDK, which makes sense, but the registry is inaccessible to the user.
   
   It would be great to be able to support something like `recordMetric` as 
[provided to the Java 
SDK](https://pulsar.apache.org/docs/en/2.4.0/functions-metrics/)
   
   A simple implementation could be to mirror this and provide a 
`context.RecordMetric(metricname string, value float64)`, though we could also 
provide package-level functions to create and register new metrics by name, 
like `pf.NewGauge(name string) (prometheus.Gauge, error)`
   


----------------------------------------------------------------
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]


Reply via email to