aboutsummaryrefslogtreecommitdiff
path: root/coremain
diff options
context:
space:
mode:
authorGravatar Tobias Schmidt <tobidt@gmail.com> 2018-01-23 21:10:55 +0100
committerGravatar Miek Gieben <miek@miek.nl> 2018-01-23 20:10:55 +0000
commitb707438534576e3f0596054a201bc271b537095e (patch)
tree6762817f84331d310db610ff40395618e19e0cd1 /coremain
parentf9c03c2ead6ae655006b3b8264b9870028884d8f (diff)
downloadcoredns-b707438534576e3f0596054a201bc271b537095e.tar.gz
coredns-b707438534576e3f0596054a201bc271b537095e.tar.zst
coredns-b707438534576e3f0596054a201bc271b537095e.zip
Add coredns_build_info metric (#1418)
In order to track the rollout status of CoreDNS versions, add the common build_info metric.
Diffstat (limited to 'coremain')
-rw-r--r--coremain/run.go8
-rw-r--r--coremain/version.go5
2 files changed, 7 insertions, 6 deletions
diff --git a/coremain/run.go b/coremain/run.go
index 69ecb6b59..61d2e24be 100644
--- a/coremain/run.go
+++ b/coremain/run.go
@@ -49,7 +49,7 @@ func init() {
caddy.SetDefaultCaddyfileLoader("default", caddy.LoaderFunc(defaultLoader))
caddy.AppName = coreName
- caddy.AppVersion = coreVersion
+ caddy.AppVersion = CoreVersion
}
// Run is CoreDNS's main() function.
@@ -180,7 +180,7 @@ func versionString() string {
// e.g.,
// linux/amd64, go1.8.3, a6d2d7b5
func releaseString() string {
- return fmt.Sprintf("%s/%s, %s, %s\n", runtime.GOOS, runtime.GOARCH, runtime.Version(), gitCommit)
+ return fmt.Sprintf("%s/%s, %s, %s\n", runtime.GOOS, runtime.GOARCH, runtime.Version(), GitCommit)
}
// setVersion figures out the version information
@@ -193,7 +193,7 @@ func setVersion() {
if gitNearestTag != "" || gitTag != "" {
if devBuild && gitNearestTag != "" {
appVersion = fmt.Sprintf("%s (+%s %s)",
- strings.TrimPrefix(gitNearestTag, "v"), gitCommit, buildDate)
+ strings.TrimPrefix(gitNearestTag, "v"), GitCommit, buildDate)
} else if gitTag != "" {
appVersion = strings.TrimPrefix(gitTag, "v")
}
@@ -252,7 +252,7 @@ var (
buildDate string // date -u
gitTag string // git describe --exact-match HEAD 2> /dev/null
gitNearestTag string // git describe --abbrev=0 --tags HEAD
- gitCommit string // git rev-parse HEAD
+ GitCommit string // git rev-parse HEAD
gitShortStat string // git diff-index --shortstat
gitFilesModified string // git diff-index --name-only HEAD
)
diff --git a/coremain/version.go b/coremain/version.go
index fbf0ed97b..93d6380e0 100644
--- a/coremain/version.go
+++ b/coremain/version.go
@@ -1,8 +1,9 @@
package coremain
const (
- coreName = "CoreDNS"
- coreVersion = "1.0.4"
+ coreName = "CoreDNS"
+ // CoreVersion is the current version of CoreDNS.
+ CoreVersion = "1.0.4"
serverType = "dns"
)