|
|
@@ -139,7 +139,7 @@ var (
|
|
|
Help: "Total number of db keys compacted.",
|
|
|
})
|
|
|
|
|
|
- dbTotalSize = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
|
|
|
+ dbTotalSizeDebugging = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
|
|
|
Namespace: "etcd_debugging",
|
|
|
Subsystem: "mvcc",
|
|
|
Name: "db_total_size_in_bytes",
|
|
|
@@ -151,9 +151,21 @@ var (
|
|
|
return reportDbTotalSizeInBytes()
|
|
|
},
|
|
|
)
|
|
|
+ dbTotalSize = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
|
|
|
+ Namespace: "etcd",
|
|
|
+ Subsystem: "mvcc",
|
|
|
+ Name: "db_total_size_in_bytes",
|
|
|
+ Help: "Total size of the underlying database in bytes.",
|
|
|
+ },
|
|
|
+ func() float64 {
|
|
|
+ reportDbTotalSizeInBytesMu.RLock()
|
|
|
+ defer reportDbTotalSizeInBytesMu.RUnlock()
|
|
|
+ return reportDbTotalSizeInBytes()
|
|
|
+ },
|
|
|
+ )
|
|
|
// overridden by mvcc initialization
|
|
|
reportDbTotalSizeInBytesMu sync.RWMutex
|
|
|
- reportDbTotalSizeInBytes func() float64 = func() float64 { return 0 }
|
|
|
+ reportDbTotalSizeInBytes = func() float64 { return 0 }
|
|
|
)
|
|
|
|
|
|
func init() {
|
|
|
@@ -171,6 +183,7 @@ func init() {
|
|
|
prometheus.MustRegister(dbCompactionPauseDurations)
|
|
|
prometheus.MustRegister(dbCompactionTotalDurations)
|
|
|
prometheus.MustRegister(dbCompactionKeysCounter)
|
|
|
+ prometheus.MustRegister(dbTotalSizeDebugging)
|
|
|
prometheus.MustRegister(dbTotalSize)
|
|
|
}
|
|
|
|