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:
Danny Kopping
2026-04-15 14:48:38 +02:00
committed by GitHub
parent d0c9571f62
commit 48b90f8cc8
6 changed files with 58 additions and 4 deletions
+4 -4
View File
@@ -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")
}