mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08: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:
@@ -1013,6 +1013,11 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
|
||||
if err = prometheusmetrics.Experiments(options.PrometheusRegistry, active); err != nil {
|
||||
return xerrors.Errorf("register experiments metric: %w", err)
|
||||
}
|
||||
|
||||
revision, _ := buildinfo.Revision()
|
||||
if err = prometheusmetrics.BuildInfo(options.PrometheusRegistry, buildinfo.Version(), revision); err != nil {
|
||||
return xerrors.Errorf("register build info metric: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// This is helpful for tests, but can be silently ignored.
|
||||
|
||||
Reference in New Issue
Block a user