diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-07-09 14:49:03 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-07-09 14:53:24 +0300 |
commit | ddf73390db3e907f0c0614a7b8031f7cbc10601b (patch) | |
tree | 2dddf2f128fbbd093135775b2a493551db7e718d /internal/praefect/version.go | |
parent | 46856e1fd24d25f22289beefa472736aadc38652 (diff) |
Export the Praefect version running
Praefect didn't expose the version running, which makes debugging
harder. This change follows conventions set by Gitaly.
A few ways of exposing the version are implemented:
1. Through the `-version` flag
2. Logging the version at boot of the server
3. A prometheus metric, the metric is stale, but the labels are not
Closes https://gitlab.com/gitlab-org/gitaly/issues/1499
Diffstat (limited to 'internal/praefect/version.go')
-rw-r--r-- | internal/praefect/version.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/praefect/version.go b/internal/praefect/version.go new file mode 100644 index 000000000..25758f35a --- /dev/null +++ b/internal/praefect/version.go @@ -0,0 +1,22 @@ +package praefect + +import ( + "fmt" + + "gitlab.com/gitlab-org/gitaly/internal/version" +) + +// GetVersionString returns a standard version header +func GetVersionString() string { + return fmt.Sprintf("Praefect, version %v", version.GetVersion()) +} + +// GetVersion returns the semver compatible version number +func GetVersion() string { + return version.GetVersion() +} + +// GetBuildTime returns the time at which the build took place +func GetBuildTime() string { + return version.GetBuildTime() +} |