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

util/promlint: consider moving to github.com/prometheus/common #5317

Open
mdlayher opened this Issue Mar 8, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@mdlayher
Copy link
Member

mdlayher commented Mar 8, 2019

Proposal

I originally added promlint for use in promtool check metrics. It is very useful for that purpose, however, it would also be nice to allow the package to be easily vendored and used in other applications for unit tests and such.

Because this main Prometheus repository is fairly large and also contains a great deal of unrelated code, I propose moving util/promlint to github.com/prometheus/common/promlint or similar. This way, library code lives with a library instead of an entire application, and is much easier to vendor.

At that point, we can vendor in the updated copy of common and switch the import statements used within promtool.

@mdlayher

This comment has been minimized.

Copy link
Member Author

mdlayher commented Mar 8, 2019

Talked with @SuperQ on IRC and it appears I was wrong about needing to vendor the entire repo. dep at least appears to pick out the package by itself if I dep ensure -add github.com/prometheus/prometheus/util/promlint.

✔ ~/src/xxx/vendor/github.com/prometheus/prometheus [master|✚ 2…1⚑ 4] 
14:37 $ ls -laR
.:
total 28
drwxr-xr-x 3 matt matt  4096 Mar  8 14:34 .
drwxr-xr-x 7 matt matt  4096 Mar  8 14:34 ..
-rw-r--r-- 1 matt matt 11357 Mar  8 14:34 LICENSE
-rw-r--r-- 1 matt matt  2769 Mar  8 14:34 NOTICE
drwxr-xr-x 3 matt matt  4096 Mar  8 14:34 util

./util:
total 12
drwxr-xr-x 3 matt matt 4096 Mar  8 14:34 .
drwxr-xr-x 3 matt matt 4096 Mar  8 14:34 ..
drwxr-xr-x 2 matt matt 4096 Mar  8 14:34 promlint

./util/promlint:
total 16
drwxr-xr-x 2 matt matt 4096 Mar  8 14:34 .
drwxr-xr-x 3 matt matt 4096 Mar  8 14:34 ..
-rw-r--r-- 1 matt matt 6733 Mar  8 14:34 promlint.go

I do still think it'd be reasonable to move this to common, though.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 8, 2019

It's only used in one of our repos, so I see no need to move it to common. Common is for stuff shared across our repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.