mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
feat: add coder_build_info metric (#24365)
_Disclaimer: produced by Claude Opus 4.6_ Adds a `coder_build_info` metric which allows operators to see which versions of Coder are currently running. --------- Signed-off-by: Danny Kopping <danny@coder.com>
This commit is contained in:
@@ -48,7 +48,7 @@ const (
|
||||
// Use golang.org/x/mod/semver to compare versions.
|
||||
func Version() string {
|
||||
readVersion.Do(func() {
|
||||
revision, valid := revision()
|
||||
revision, valid := Revision()
|
||||
if valid {
|
||||
revision = "+" + revision[:7]
|
||||
}
|
||||
@@ -124,7 +124,7 @@ func IsBoringCrypto() bool {
|
||||
func ExternalURL() string {
|
||||
readExternalURL.Do(func() {
|
||||
repo := "https://github.com/coder/coder"
|
||||
revision, valid := revision()
|
||||
revision, valid := Revision()
|
||||
if !valid {
|
||||
externalURL = repo
|
||||
return
|
||||
@@ -147,8 +147,8 @@ func Time() (time.Time, bool) {
|
||||
return parsed, true
|
||||
}
|
||||
|
||||
// revision returns the Git hash of the build.
|
||||
func revision() (string, bool) {
|
||||
// Revision returns the full Git hash of the build.
|
||||
func Revision() (string, bool) {
|
||||
return find("vcs.revision")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user