Merge pull request #9957 from gyuho/go-version
etcdserver: add "etcd_server_go_version" metricrelease-3.4
commit
3f725e190e
|
@ -15,6 +15,7 @@
|
||||||
package etcdserver
|
package etcdserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
goruntime "runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/coreos/etcd/pkg/runtime"
|
"github.com/coreos/etcd/pkg/runtime"
|
||||||
|
@ -104,6 +105,13 @@ var (
|
||||||
Help: "Which version is running. 1 for 'server_version' label with current version.",
|
Help: "Which version is running. 1 for 'server_version' label with current version.",
|
||||||
},
|
},
|
||||||
[]string{"server_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() {
|
func init() {
|
||||||
|
@ -120,10 +128,14 @@ func init() {
|
||||||
prometheus.MustRegister(leaseExpired)
|
prometheus.MustRegister(leaseExpired)
|
||||||
prometheus.MustRegister(quotaBackendBytes)
|
prometheus.MustRegister(quotaBackendBytes)
|
||||||
prometheus.MustRegister(currentVersion)
|
prometheus.MustRegister(currentVersion)
|
||||||
|
prometheus.MustRegister(currentGoVersion)
|
||||||
|
|
||||||
currentVersion.With(prometheus.Labels{
|
currentVersion.With(prometheus.Labels{
|
||||||
"server_version": version.Version,
|
"server_version": version.Version,
|
||||||
}).Set(1)
|
}).Set(1)
|
||||||
|
currentGoVersion.With(prometheus.Labels{
|
||||||
|
"server_go_version": goruntime.Version(),
|
||||||
|
}).Set(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func monitorFileDescriptor(lg *zap.Logger, done <-chan struct{}) {
|
func monitorFileDescriptor(lg *zap.Logger, done <-chan struct{}) {
|
||||||
|
|
Loading…
Reference in New Issue