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

Refactor to "plugin" model #46

Closed
bduffany opened this issue Dec 9, 2020 · 2 comments
Closed

Refactor to "plugin" model #46

bduffany opened this issue Dec 9, 2020 · 2 comments

Comments

@bduffany
Copy link

bduffany commented Dec 9, 2020

This package looks super useful, but I wound up not using it because it has a bunch of deps on several different HTTP frameworks, which significantly increased the size of our go.sum.

It would be nicer to have a "plugin" model where you go get each framework-specific plugin separately, to avoid dependency bloat. (IMO the built-in "net/http" plugin could be included in this repo but the other 3rd-party frameworks should be separate repos).

@slok
Copy link
Owner

slok commented Dec 9, 2020

Hi @bduffany!

Thanks for your kind words!

The library tackles already the problem you are saying, when you import go-http-metrics, each of the library/framework dependency has its own package for this reason so you don't import all of them.

I've put here an example so you can check by yourself that you are not importing N frameworks while using this library: https://github.com/slok/go-http-metrics-imports

Regarding the go.sum thing, we can't do anything about that, it's how Go stores the data.

Anyway IMHO, having those lines in the go.sum is not a big deal while the dependencies don't end up on the application. In the end is just a text file for computers, not humans (contrary to go.mod that is common to read it).

Thanks!

@slok
Copy link
Owner

slok commented Dec 12, 2020

I'm closing the issue, if you need more information, please reopen the issue. Thanks!

@slok slok closed this as completed Dec 12, 2020
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

No branches or pull requests

2 participants