You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/03/01 22:55:07 UTC

[GitHub] [pulsar] flowchartsman opened a new issue #9772: [Go Functions] Allow user metrics

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



[GitHub] [pulsar] wolfstudy commented on issue #9772: [Go Functions] Allow user metrics

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #9772:
URL: https://github.com/apache/pulsar/issues/9772#issuecomment-791119662


   Thanks @flowchartsman proposal, This is indeed the missing feature of Go Function. Are you interested in this? Welcome to submit a pull request to support this feature.


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



[GitHub] [pulsar] freeznet closed issue #9772: [Go Functions] Allow user metrics

Posted by GitBox <gi...@apache.org>.
freeznet closed issue #9772:
URL: https://github.com/apache/pulsar/issues/9772


   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] flowchartsman commented on issue #9772: [Go Functions] Allow user metrics

Posted by GitBox <gi...@apache.org>.
flowchartsman commented on issue #9772:
URL: https://github.com/apache/pulsar/issues/9772#issuecomment-788370006


   I'd be willing to take a crack at this. @codelipenghui, @wolfstudy do you know if it would be enough to register metrics with the registry to have them exposed, or would it be necessary to do work on the runtime as well?


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



[GitHub] [pulsar] flowchartsman commented on issue #9772: [Go Functions] Allow user metrics

Posted by GitBox <gi...@apache.org>.
flowchartsman commented on issue #9772:
URL: https://github.com/apache/pulsar/issues/9772#issuecomment-792786185


   Yeah, not a problem, any thoughts on implementation? I am tempted to add methods into `pf`


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