feat: label build identity in metrics
This commit is contained in:
@@ -6,6 +6,8 @@ import (
|
||||
"errors"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"git.yuntuo.hk/k2safe/orbit/internal/buildinfo"
|
||||
)
|
||||
|
||||
// initializeProcess is called once by the registry constructor.
|
||||
@@ -14,7 +16,8 @@ func (r *Registry) initializeProcess() {
|
||||
return
|
||||
}
|
||||
r.SetGauge("orbit_process_start_time_seconds", float64(r.started.Unix()), nil)
|
||||
r.SetGauge("orbit_build_info", 1, Labels{"go_version": runtime.Version()})
|
||||
build := buildinfo.Current()
|
||||
r.SetGauge("orbit_build_info", 1, Labels{"go_version": build.GoVersion, "version": build.Version, "revision": build.Revision})
|
||||
r.RecordProcess()
|
||||
for _, component := range components {
|
||||
labels := Labels{"component": component}
|
||||
|
||||
Reference in New Issue
Block a user