-
Notifications
You must be signed in to change notification settings - Fork 294
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
fix(fabric): Multiple objects of the ledger connector class throws errors with prometheus exporter object #634
Comments
@jagpreetsinghsasan My recommendation here is to pull the exporter state out of the individual plugins to a dedicated singleton-ish** instance and then have the N number of Fabric connector plugins share that instance among themselves. Easiest would be to have a There's other options but if you ask me they are all much more heavy handed rabbit-holes, most notably IoC containers, that will still mostly suffer from the same problems anyway due to some specifics of the language/NodeJS itself. ** the |
Primary Change -------------- 1. Adding the default_metrics to the registry object which will differ for different objects. Fixes hyperledger-cacti#634 Signed-off-by: Jagpreet Singh Sasan <[email protected]>
Primary Change -------------- 1. Adding the default_metrics to the registry object which will differ for different objects. Fixes #634 Signed-off-by: Jagpreet Singh Sasan <[email protected]>
Primary Change -------------- 1. Adding the default_metrics to the registry object which will differ for different objects. Fixes hyperledger-cacti#634 Signed-off-by: Jagpreet Singh Sasan <[email protected]>
Primary Change -------------- 1. Adding the default_metrics to the registry object which will differ for different objects. Fixes hyperledger-cacti#634 Signed-off-by: Jagpreet Singh Sasan <[email protected]>
Describe the bug
When multiple objects of the ledger-connector-fabric are instantiated, it causes issues with prometheus exporter object initialization.
To Reproduce
Instantiate multiple ledger-connector-fabric objects.
prometheus exporter object throws error stating
Error: A metric with the name process_cpu_user_seconds_total has already been registered.
Expected behavior
Multiple object initialization should occur without any issues.
Hyperledger Cactus Plugins/Connectors Used
Additional context
Mostly the issue is with the
collectDefaultMetrics
function located under/cactus/packages/cactus-plugin-ledger-connector-fabric/src/main/typescript/prometheus-exporter/prometheus-exporter.ts
. Requires more root cause analysis before concluding the reason of the error.The text was updated successfully, but these errors were encountered: