diff --git a/weed/stats/constants_4bytes.go b/weed/stats/constants_4bytes.go deleted file mode 100644 index 352b24519..000000000 --- a/weed/stats/constants_4bytes.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build !5BytesOffset -// +build !5BytesOffset - -package stats - -const ( - SizeLimit = "30GB" -) - diff --git a/weed/stats/constants_5bytes.go b/weed/stats/constants_5bytes.go deleted file mode 100644 index e4e6e4a05..000000000 --- a/weed/stats/constants_5bytes.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build 5BytesOffset -// +build 5BytesOffset - -package stats - -const ( - SizeLimit = "8000GB" -) - diff --git a/weed/stats/metrics.go b/weed/stats/metrics.go index deefeee34..f46d6b86c 100644 --- a/weed/stats/metrics.go +++ b/weed/stats/metrics.go @@ -17,20 +17,11 @@ import ( "github.com/seaweedfs/seaweedfs/weed/glog" ) -// Version info - these are set by the version package to avoid import cycles -var ( - versionNumber = "unknown" - commit = "" -) - // SetVersionInfo sets the version information for the BuildInfo metric // This is called by the version package during initialization -func SetVersionInfo(version, commitHash string) { - versionNumber = version - commit = commitHash - // Update the metric with the new values +func SetVersionInfo(version, commitHash, sizeLimit string) { BuildInfo.Reset() - BuildInfo.WithLabelValues(versionNumber, commit, SizeLimit, runtime.GOOS, runtime.GOARCH).Set(1) + BuildInfo.WithLabelValues(version, commitHash, sizeLimit, runtime.GOOS, runtime.GOARCH).Set(1) } // Readonly volume types diff --git a/weed/util/version/constants.go b/weed/util/version/constants.go index bb3bfa614..8cbe2225a 100644 --- a/weed/util/version/constants.go +++ b/weed/util/version/constants.go @@ -17,7 +17,7 @@ var ( func init() { // Set version info in stats for Prometheus metrics - stats.SetVersionInfo(VERSION_NUMBER, COMMIT) + stats.SetVersionInfo(VERSION_NUMBER, COMMIT, util.SizeLimit) } func Version() string {