Skip to content
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

feat!: switch to metrics generator pattern #233

Merged
merged 2 commits into from
Jan 14, 2023
Merged

Conversation

wemeetagain
Copy link
Member

Resolves #225

This will allow us to add metrics in a more agile way, since this library now maintains all code to create metrics.

This is a breaking change, since now, to enable metrics, instead of passing a IDiscv5Metrics object in the constructor, you pass a Registry object (and this library constructs the IDiscv5Metrics object)

Before:
Discv5.create({..., metrics})

After:
Discv5.create({..., metricsRegistry})

@wemeetagain wemeetagain requested a review from a team as a code owner January 13, 2023 22:46
package.json Outdated
@@ -105,6 +105,7 @@
"debug": "^4.3.1",
"dgram": "^1.0.1",
"err-code": "^3.0.1",
"prom-client": "^14.1.0",
Copy link
Contributor

@dapplion dapplion Jan 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think discv5 should depend on prom-client directly. Instead just expect an specific interface that implements a metrics factory

@dapplion dapplion merged commit 1751192 into master Jan 14, 2023
@dapplion dapplion deleted the cayman/metrics-generator branch January 14, 2023 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to metrics generator pattern
2 participants