-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prometheus Metrics #113
Prometheus Metrics #113
Conversation
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Philip-21 thanks for looking at adding the metrics!
Instead of using the prometheus library directly, there is a standard util in firefly-common which can help organise metrics when it grows bigger. An example usage can be found here: https://github.com/hyperledger/firefly-transaction-manager/blob/main/internal/metrics/metrics.go
Thanks for the feedback, will make necessary implementations |
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
Hey @Chengxuan please checkout the changes I have made, I made necessary adjustments for handling the metrics, my main issue is being able to configure the metrics server to run properly, I need your reviews on this please ? |
@Philip-21 Thanks for the update. I realised what I explained above wasn't very clear. FFTM already has a metrics manager and I believe that metrics manager is the one that EVM connect should use for collecting metrics so that the custom metrics collected in EVM connect are served at the same metrics server as other metrics. https://github.com/hyperledger/firefly-evmconnect/blob/main/cmd/evmconnect.go#L102 is where EVM connect uses FFTM to initialize the HTTP & metrics server. There is already an example showing how Tx Handler registers and emits its custom metrics in https://github.com/hyperledger/firefly-transaction-manager/blob/main/internal/metrics/metrics.go through Therefore, EVM connect could follow the same pattern. e.g. there can be a new |
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
Hey @Chengxuan I have created Evm handlers for handling and emitting metrics, Please have a look on how i defined them and configured them to run and initialize in the |
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
Hi @Philip-21 , Thanks for giving it another try. The Therefore, as a consumer of that library, FF evmconnect need to find a way to emit metrics using a In this PR, a new |
Thanks for the feedback and the breakdown, i will make adjustments |
I've ben unable to import the metrics registry from the fftm to be used for the Evmmetrics manager, since the metric registry for the fftm is located in the internal package i am unable to import and use it, leads to an import error , i am still figuring out a better approach to this, please what could be the best way |
@Philip-21 one option is to use a public interface and implement the internal object with the required methods then pass through it to evmconnect during initialization. But other proposals are welcome as well. If you decided to go with a public interface, you might want to take a look at https://github.com/hyperledger/firefly-transaction-manager/blob/543a25094959495265d042083db8120169fcecf2/pkg/txhandler/txhandler.go#L76 , I feel that interface is generic enough to be re-used as it doesn't contain transaction handler specific knowledge. |
Hey @Chengxuan , I think its best we use the But does |
Hi @Philip-21 here is an example of adding event metrics in FFTM repo: hyperledger/firefly-transaction-manager#121 which could be a useful learning point for adding metrics for EVM connect. |
Alright looking through ........ |
Closing this PR for now as it seems the work has been parked. Please feel free to re-open when you continue @Philip-21 👍 |
Pr fixes for #34
Creating prometheus instrumentation for FFEVM