2022-01-26 21:40:44 +05:30
|
|
|
package version
|
|
|
|
|
|
|
|
|
|
import (
|
2022-02-01 23:03:16 +05:30
|
|
|
"fmt"
|
|
|
|
|
"runtime"
|
2022-01-26 21:40:44 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// These fields are set during an official build
|
|
|
|
|
// Global vars set from command-line arguments
|
|
|
|
|
var (
|
2022-02-01 23:03:16 +05:30
|
|
|
buildVersion = "--"
|
|
|
|
|
buildHash = "--"
|
|
|
|
|
buildTime = "--"
|
|
|
|
|
gitBranch = "--"
|
2022-01-26 21:40:44 +05:30
|
|
|
)
|
|
|
|
|
|
2022-02-01 23:03:16 +05:30
|
|
|
// BuildDetails returns a string containing details about the SigNoz query-service binary.
|
|
|
|
|
func BuildDetails() string {
|
2022-09-14 12:36:33 +05:30
|
|
|
licenseInfo := `Check SigNoz Github repo for license details`
|
2022-02-01 23:03:16 +05:30
|
|
|
|
|
|
|
|
return fmt.Sprintf(`
|
|
|
|
|
SigNoz version : %v
|
|
|
|
|
Commit SHA-1 : %v
|
|
|
|
|
Commit timestamp : %v
|
|
|
|
|
Branch : %v
|
|
|
|
|
Go version : %v
|
|
|
|
|
|
2024-07-18 17:25:32 +05:30
|
|
|
For SigNoz Official Documentation, visit https://signoz.io/docs/
|
|
|
|
|
For SigNoz Community Slack, visit http://signoz.io/slack/
|
|
|
|
|
For archive of discussions about SigNoz, visit https://knowledgebase.signoz.io/
|
2022-02-01 23:03:16 +05:30
|
|
|
|
|
|
|
|
%s.
|
2024-07-18 17:25:32 +05:30
|
|
|
Copyright 2024 SigNoz
|
2022-02-01 23:03:16 +05:30
|
|
|
`,
|
|
|
|
|
buildVersion, buildHash, buildTime, gitBranch,
|
|
|
|
|
runtime.Version(), licenseInfo)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PrintVersion prints version and other helpful information.
|
|
|
|
|
func PrintVersion() {
|
2024-03-27 00:07:29 +05:30
|
|
|
fmt.Println(BuildDetails())
|
2022-01-26 21:40:44 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetVersion() string {
|
2022-02-01 23:03:16 +05:30
|
|
|
return buildVersion
|
2022-01-26 21:40:44 +05:30
|
|
|
}
|