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
Add build-time information as metric and in logs #61
Comments
We should add this to the |
I have been looking into if there are some ways these days to include version information in the binaries without using ldflags or go generate. My biggest issue with those mentioned approaches are that they require a special build step, as opposed to just using "go build" or "go install". What I have arrived at is that runtime/debug.BulldInfo is almost exactly what we are looking for - with a caveat. Due to golang/go#29228 any build using the normal "go build" will be tagged with just "(devel)". For an example, check out https://github.com/mark-rushakoff/debug-module-version-demo.
So for us that would mean that you could Then we could also add a Makefile to aid people wanting to use a "go build"-like flow to create a version such as What do you think @secustor? EDIT: Long-term we can adopt golang/go#37475 as well. |
I have been thinking about more in the The question from my point of view is, who will rely on this in the future? We are providing prebuild images and binaries, in which we can add versions as we see fit. Therefore I think we should add the git SHA and tag during the build step of the binaries and something like this to our code so if somebody installs our package we can display informations. |
🎉 This issue has been resolved in version 1.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
We should expose what git commit was used to build the currently running exporter, as well as any tag associated with it. That way it is easier to reason about what version was running both in the logs and in metrics.
The text was updated successfully, but these errors were encountered: