Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etcdserver: add "etcd_server_go_version" metric #9957

Merged
merged 1 commit into from
Jul 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions etcdserver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package etcdserver

import (
goruntime "runtime"
"time"

"github.com/coreos/etcd/pkg/runtime"
Expand Down Expand Up @@ -104,6 +105,13 @@ var (
Help: "Which version is running. 1 for 'server_version' label with current version.",
},
[]string{"server_version"})
currentGoVersion = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "go_version",
Help: "Which Go version server is running with. 1 for 'server_go_version' label with current version.",
},
[]string{"server_go_version"})
)

func init() {
Expand All @@ -120,10 +128,14 @@ func init() {
prometheus.MustRegister(leaseExpired)
prometheus.MustRegister(quotaBackendBytes)
prometheus.MustRegister(currentVersion)
prometheus.MustRegister(currentGoVersion)

currentVersion.With(prometheus.Labels{
"server_version": version.Version,
}).Set(1)
currentGoVersion.With(prometheus.Labels{
"server_go_version": goruntime.Version(),
}).Set(1)
}

func monitorFileDescriptor(lg *zap.Logger, done <-chan struct{}) {
Expand Down