File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import (
18
18
"time"
19
19
20
20
"github.com/coreos/etcd/pkg/runtime"
21
+ "github.com/coreos/etcd/version"
21
22
"github.com/prometheus/client_golang/prometheus"
22
23
)
23
24
64
65
Name : "proposals_failed_total" ,
65
66
Help : "The total number of failed proposals seen." ,
66
67
})
68
+ currentVersion = prometheus .NewGaugeVec (prometheus.GaugeOpts {
69
+ Namespace : "etcd" ,
70
+ Subsystem : "server" ,
71
+ Name : "version" ,
72
+ Help : "Which version is running. 1 for 'server_version' label with current version." ,
73
+ },
74
+ []string {"server_version" })
67
75
)
68
76
69
77
func init () {
@@ -74,6 +82,11 @@ func init() {
74
82
prometheus .MustRegister (proposalsApplied )
75
83
prometheus .MustRegister (proposalsPending )
76
84
prometheus .MustRegister (proposalsFailed )
85
+ prometheus .MustRegister (currentVersion )
86
+
87
+ currentVersion .With (prometheus.Labels {
88
+ "server_version" : version .Version ,
89
+ }).Set (1 )
77
90
}
78
91
79
92
func monitorFileDescriptor (done <- chan struct {}) {
You can’t perform that action at this time.
0 commit comments