add build info metrics (#7525)

* add build info metrics

* unused

* metrics on build

* size limit

* once
This commit is contained in:
Chris Lu
2025-11-21 16:55:28 -08:00
committed by GitHub
parent a77dfb1ddd
commit 5f7a292334
3 changed files with 112 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ package version
import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/stats"
"github.com/seaweedfs/seaweedfs/weed/util"
)
@@ -14,6 +15,11 @@ var (
COMMIT = ""
)
func init() {
// Set version info in stats for Prometheus metrics
stats.SetVersionInfo(VERSION_NUMBER, COMMIT, util.SizeLimit)
}
func Version() string {
return VERSION + " " + COMMIT
}