format all prometheus metrics to ensure nice indent

Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
This commit is contained in:
Benjamin Wang
2025-01-29 13:42:06 +00:00
parent 35d20d1e08
commit 614640f1c2
11 changed files with 310 additions and 245 deletions

View File

@ -21,12 +21,13 @@ import (
)
var (
currentAuthRevision = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Namespace: "etcd_debugging",
Subsystem: "auth",
Name: "revision",
Help: "The current revision of auth store.",
},
currentAuthRevision = prometheus.NewGaugeFunc(
prometheus.GaugeOpts{
Namespace: "etcd_debugging",
Subsystem: "auth",
Name: "revision",
Help: "The current revision of auth store.",
},
func() float64 {
reportCurrentAuthRevMu.RLock()
defer reportCurrentAuthRevMu.RUnlock()

View File

@ -120,20 +120,22 @@ var (
Name: "health_failures",
Help: "The total number of failed health checks",
})
healthCheckGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "healthcheck",
Help: "The result of each kind of healthcheck.",
},
healthCheckGauge = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "healthcheck",
Help: "The result of each kind of healthcheck.",
},
[]string{"type", "name"},
)
healthCheckCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "healthchecks_total",
Help: "The total number of each kind of healthcheck.",
},
healthCheckCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "healthchecks_total",
Help: "The total number of each kind of healthcheck.",
},
[]string{"type", "name", "status"},
)
)

View File

@ -17,19 +17,22 @@ package membership
import "github.com/prometheus/client_golang/prometheus"
var (
ClusterVersionMetrics = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "cluster",
Name: "version",
Help: "Which version is running. 1 for 'cluster_version' label with current cluster version",
},
[]string{"cluster_version"})
knownPeers = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "known_peers",
Help: "The current number of known peers.",
},
ClusterVersionMetrics = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "cluster",
Name: "version",
Help: "Which version is running. 1 for 'cluster_version' label with current cluster version",
},
[]string{"cluster_version"},
)
knownPeers = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "known_peers",
Help: "The current number of known peers.",
},
[]string{"Local", "Remote"},
)
isLearner = prometheus.NewGauge(prometheus.GaugeOpts{

View File

@ -17,150 +17,165 @@ package rafthttp
import "github.com/prometheus/client_golang/prometheus"
var (
activePeers = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "active_peers",
Help: "The current number of active peer connections.",
},
activePeers = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "active_peers",
Help: "The current number of active peer connections.",
},
[]string{"Local", "Remote"},
)
disconnectedPeers = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "disconnected_peers_total",
Help: "The total number of disconnected peers.",
},
disconnectedPeers = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "disconnected_peers_total",
Help: "The total number of disconnected peers.",
},
[]string{"Local", "Remote"},
)
sentBytes = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "peer_sent_bytes_total",
Help: "The total number of bytes sent to peers.",
},
sentBytes = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "peer_sent_bytes_total",
Help: "The total number of bytes sent to peers.",
},
[]string{"To"},
)
receivedBytes = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "peer_received_bytes_total",
Help: "The total number of bytes received from peers.",
},
receivedBytes = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "peer_received_bytes_total",
Help: "The total number of bytes received from peers.",
},
[]string{"From"},
)
sentFailures = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "peer_sent_failures_total",
Help: "The total number of send failures from peers.",
},
sentFailures = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "peer_sent_failures_total",
Help: "The total number of send failures from peers.",
},
[]string{"To"},
)
recvFailures = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "peer_received_failures_total",
Help: "The total number of receive failures from peers.",
},
recvFailures = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "peer_received_failures_total",
Help: "The total number of receive failures from peers.",
},
[]string{"From"},
)
snapshotSend = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_send_success",
Help: "Total number of successful snapshot sends",
},
snapshotSend = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_send_success",
Help: "Total number of successful snapshot sends",
},
[]string{"To"},
)
snapshotSendInflights = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_send_inflights_total",
Help: "Total number of inflight snapshot sends",
},
snapshotSendInflights = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_send_inflights_total",
Help: "Total number of inflight snapshot sends",
},
[]string{"To"},
)
snapshotSendFailures = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_send_failures",
Help: "Total number of snapshot send failures",
},
snapshotSendFailures = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_send_failures",
Help: "Total number of snapshot send failures",
},
[]string{"To"},
)
snapshotSendSeconds = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_send_total_duration_seconds",
Help: "Total latency distributions of v3 snapshot sends",
snapshotSendSeconds = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_send_total_duration_seconds",
Help: "Total latency distributions of v3 snapshot sends",
// lowest bucket start of upper bound 0.1 sec (100 ms) with factor 2
// highest bucket start of 0.1 sec * 2^9 == 51.2 sec
Buckets: prometheus.ExponentialBuckets(0.1, 2, 10),
},
// lowest bucket start of upper bound 0.1 sec (100 ms) with factor 2
// highest bucket start of 0.1 sec * 2^9 == 51.2 sec
Buckets: prometheus.ExponentialBuckets(0.1, 2, 10),
},
[]string{"To"},
)
snapshotReceive = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_receive_success",
Help: "Total number of successful snapshot receives",
},
snapshotReceive = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_receive_success",
Help: "Total number of successful snapshot receives",
},
[]string{"From"},
)
snapshotReceiveInflights = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_receive_inflights_total",
Help: "Total number of inflight snapshot receives",
},
snapshotReceiveInflights = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_receive_inflights_total",
Help: "Total number of inflight snapshot receives",
},
[]string{"From"},
)
snapshotReceiveFailures = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_receive_failures",
Help: "Total number of snapshot receive failures",
},
snapshotReceiveFailures = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_receive_failures",
Help: "Total number of snapshot receive failures",
},
[]string{"From"},
)
snapshotReceiveSeconds = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_receive_total_duration_seconds",
Help: "Total latency distributions of v3 snapshot receives",
snapshotReceiveSeconds = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "snapshot_receive_total_duration_seconds",
Help: "Total latency distributions of v3 snapshot receives",
// lowest bucket start of upper bound 0.1 sec (100 ms) with factor 2
// highest bucket start of 0.1 sec * 2^9 == 51.2 sec
Buckets: prometheus.ExponentialBuckets(0.1, 2, 10),
},
// lowest bucket start of upper bound 0.1 sec (100 ms) with factor 2
// highest bucket start of 0.1 sec * 2^9 == 51.2 sec
Buckets: prometheus.ExponentialBuckets(0.1, 2, 10),
},
[]string{"From"},
)
rttSec = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "peer_round_trip_time_seconds",
Help: "Round-Trip-Time histogram between peers",
rttSec = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "peer_round_trip_time_seconds",
Help: "Round-Trip-Time histogram between peers",
// lowest bucket start of upper bound 0.0001 sec (0.1 ms) with factor 2
// highest bucket start of 0.0001 sec * 2^15 == 3.2768 sec
Buckets: prometheus.ExponentialBuckets(0.0001, 2, 16),
},
// lowest bucket start of upper bound 0.0001 sec (0.1 ms) with factor 2
// highest bucket start of 0.0001 sec * 2^15 == 3.2768 sec
Buckets: prometheus.ExponentialBuckets(0.0001, 2, 16),
},
[]string{"To"},
)
)

View File

@ -28,7 +28,9 @@ var (
Subsystem: "store",
Name: "reads_total",
Help: "Total number of reads action by (get/getRecursive), local to this member.",
}, []string{"action"})
},
[]string{"action"},
)
writeCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
@ -36,7 +38,9 @@ var (
Subsystem: "store",
Name: "writes_total",
Help: "Total number of writes (e.g. set/compareAndDelete) seen by this member.",
}, []string{"action"})
},
[]string{"action"},
)
readFailedCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
@ -44,7 +48,9 @@ var (
Subsystem: "store",
Name: "reads_failed_total",
Help: "Failed read actions by (get/getRecursive), local to this member.",
}, []string{"action"})
},
[]string{"action"},
)
writeFailedCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
@ -52,7 +58,9 @@ var (
Subsystem: "store",
Name: "writes_failed_total",
Help: "Failed write actions (e.g. set/compareAndDelete), seen by this member.",
}, []string{"action"})
},
[]string{"action"},
)
expireCounter = prometheus.NewCounter(
prometheus.CounterOpts{
@ -60,7 +68,8 @@ var (
Subsystem: "store",
Name: "expires_total",
Help: "Total number of expired keys.",
})
},
)
watchRequests = prometheus.NewCounter(
prometheus.CounterOpts{
@ -68,7 +77,8 @@ var (
Subsystem: "store",
Name: "watch_requests_total",
Help: "Total number of incoming watch requests (new or reestablished).",
})
},
)
watcherCount = prometheus.NewGauge(
prometheus.GaugeOpts{
@ -76,7 +86,8 @@ var (
Subsystem: "store",
Name: "watchers",
Help: "Count of currently active watchers.",
})
},
)
)
const (

View File

@ -31,21 +31,23 @@ var (
Help: "The total number of bytes received from grpc clients.",
})
streamFailures = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "server_stream_failures_total",
Help: "The total number of stream failures from the local server.",
},
streamFailures = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "server_stream_failures_total",
Help: "The total number of stream failures from the local server.",
},
[]string{"Type", "API"},
)
clientRequests = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "client_requests_total",
Help: "The total number of client requests per client version.",
},
clientRequests = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "client_requests_total",
Help: "The total number of client requests per client version.",
},
[]string{"type", "client_api_version"},
)
)

View File

@ -16,13 +16,15 @@ package apply
import "github.com/prometheus/client_golang/prometheus"
var alarms = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "etcd_debugging",
Subsystem: "server",
Name: "alarms",
Help: "Alarms for every member in cluster. 1 for 'server_id' label with current ID. 2 for 'alarm_type' label with type of this alarm",
},
[]string{"server_id", "alarm_type"})
var alarms = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "etcd_debugging",
Subsystem: "server",
Name: "alarms",
Help: "Alarms for every member in cluster. 1 for 'server_id' label with current ID. 2 for 'alarm_type' label with type of this alarm",
},
[]string{"server_id", "alarm_type"},
)
func init() {
prometheus.MustRegister(alarms)

View File

@ -44,12 +44,13 @@ var (
Name: "leader_changes_seen_total",
Help: "The number of leader changes seen.",
})
learnerPromoteFailed = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "learner_promote_failures",
Help: "The total number of failed learner promotions (likely learner not ready) while this member is leader.",
},
learnerPromoteFailed = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "learner_promote_failures",
Help: "The total number of failed learner promotions (likely learner not ready) while this member is leader.",
},
[]string{"Reason"},
)
learnerPromoteSucceed = prometheus.NewCounter(prometheus.CounterOpts{
@ -112,29 +113,33 @@ var (
Name: "lease_expired_total",
Help: "The total number of expired leases.",
})
currentVersion = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "version",
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"})
serverID = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "id",
Help: "Server or member ID in hexadecimal format. 1 for 'server_id' label with current ID.",
},
[]string{"server_id"})
currentVersion = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "version",
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"},
)
serverID = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "id",
Help: "Server or member ID in hexadecimal format. 1 for 'server_id' label with current ID.",
},
[]string{"server_id"},
)
fdUsed = prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: "os",
Subsystem: "fd",

View File

@ -28,28 +28,32 @@ var (
Name: "slow_apply_total",
Help: "The total number of slow apply requests (likely overloaded from slow disk).",
})
applySec = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "apply_duration_seconds",
Help: "The latency distributions of v2 apply called by backend.",
applySec = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "apply_duration_seconds",
Help: "The latency distributions of v2 apply called by backend.",
// lowest bucket start of upper bound 0.0001 sec (0.1 ms) with factor 2
// highest bucket start of 0.0001 sec * 2^19 == 52.4288 sec
Buckets: prometheus.ExponentialBuckets(0.0001, 2, 20),
},
[]string{"version", "op", "success"})
rangeSec = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "range_duration_seconds",
Help: "The latency distributions of txn.Range",
// lowest bucket start of upper bound 0.0001 sec (0.1 ms) with factor 2
// highest bucket start of 0.0001 sec * 2^19 == 52.4288 sec
Buckets: prometheus.ExponentialBuckets(0.0001, 2, 20),
},
[]string{"version", "op", "success"},
)
rangeSec = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "range_duration_seconds",
Help: "The latency distributions of txn.Range",
// lowest bucket start of upper bound 0.0001 sec (0.1 ms) with factor 2
// highest bucket start of 0.0001 sec * 2^19 == 52.4288 sec
Buckets: prometheus.ExponentialBuckets(0.0001, 2, 20),
},
[]string{"success"})
// lowest bucket start of upper bound 0.0001 sec (0.1 ms) with factor 2
// highest bucket start of 0.0001 sec * 2^19 == 52.4288 sec
Buckets: prometheus.ExponentialBuckets(0.0001, 2, 20),
},
[]string{"success"},
)
)
func ApplySecObserve(version, op string, success bool, latency time.Duration) {

View File

@ -48,7 +48,8 @@ var (
Help: "Bucketed histogram of lease TTLs.",
// 1 second -> 3 months
Buckets: prometheus.ExponentialBuckets(1, 2, 24),
})
},
)
)
func init() {

View File

@ -27,7 +27,8 @@ var (
Subsystem: "mvcc",
Name: "range_total",
Help: "Total number of ranges seen by this member.",
})
},
)
putCounter = prometheus.NewCounter(
prometheus.CounterOpts{
@ -35,7 +36,8 @@ var (
Subsystem: "mvcc",
Name: "put_total",
Help: "Total number of puts seen by this member.",
})
},
)
deleteCounter = prometheus.NewCounter(
prometheus.CounterOpts{
@ -43,7 +45,8 @@ var (
Subsystem: "mvcc",
Name: "delete_total",
Help: "Total number of deletes seen by this member.",
})
},
)
txnCounter = prometheus.NewCounter(
prometheus.CounterOpts{
@ -51,7 +54,8 @@ var (
Subsystem: "mvcc",
Name: "txn_total",
Help: "Total number of txns seen by this member.",
})
},
)
keysGauge = prometheus.NewGauge(
prometheus.GaugeOpts{
@ -59,7 +63,8 @@ var (
Subsystem: "mvcc",
Name: "keys_total",
Help: "Total number of keys.",
})
},
)
watchStreamGauge = prometheus.NewGauge(
prometheus.GaugeOpts{
@ -67,7 +72,8 @@ var (
Subsystem: "mvcc",
Name: "watch_stream_total",
Help: "Total number of watch streams.",
})
},
)
watcherGauge = prometheus.NewGauge(
prometheus.GaugeOpts{
@ -75,7 +81,8 @@ var (
Subsystem: "mvcc",
Name: "watcher_total",
Help: "Total number of watchers.",
})
},
)
slowWatcherGauge = prometheus.NewGauge(
prometheus.GaugeOpts{
@ -83,7 +90,8 @@ var (
Subsystem: "mvcc",
Name: "slow_watcher_total",
Help: "Total number of unsynced slow watchers.",
})
},
)
totalEventsCounter = prometheus.NewCounter(
prometheus.CounterOpts{
@ -91,7 +99,8 @@ var (
Subsystem: "mvcc",
Name: "events_total",
Help: "Total number of events sent by this member.",
})
},
)
pendingEventsGauge = prometheus.NewGauge(
prometheus.GaugeOpts{
@ -99,7 +108,8 @@ var (
Subsystem: "mvcc",
Name: "pending_events_total",
Help: "Total number of pending events to be sent.",
})
},
)
indexCompactionPauseMs = prometheus.NewHistogram(
prometheus.HistogramOpts{
@ -111,7 +121,8 @@ var (
// lowest bucket start of upper bound 0.5 ms with factor 2
// highest bucket start of 0.5 ms * 2^13 == 4.096 sec
Buckets: prometheus.ExponentialBuckets(0.5, 2, 14),
})
},
)
dbCompactionPauseMs = prometheus.NewHistogram(
prometheus.HistogramOpts{
@ -123,7 +134,8 @@ var (
// lowest bucket start of upper bound 1 ms with factor 2
// highest bucket start of 1 ms * 2^12 == 4.096 sec
Buckets: prometheus.ExponentialBuckets(1, 2, 13),
})
},
)
dbCompactionTotalMs = prometheus.NewHistogram(
prometheus.HistogramOpts{
@ -135,7 +147,8 @@ var (
// lowest bucket start of upper bound 100 ms with factor 2
// highest bucket start of 100 ms * 2^13 == 8.192 sec
Buckets: prometheus.ExponentialBuckets(100, 2, 14),
})
},
)
dbCompactionLast = prometheus.NewGauge(
prometheus.GaugeOpts{
@ -143,7 +156,8 @@ var (
Subsystem: "mvcc",
Name: "db_compaction_last",
Help: "The unix time of the last db compaction. Resets to 0 on start.",
})
},
)
dbCompactionKeysCounter = prometheus.NewCounter(
prometheus.CounterOpts{
@ -151,14 +165,16 @@ var (
Subsystem: "mvcc",
Name: "db_compaction_keys_total",
Help: "Total number of db keys compacted.",
})
},
)
dbTotalSize = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "mvcc",
Name: "db_total_size_in_bytes",
Help: "Total size of the underlying database physically allocated in bytes.",
},
dbTotalSize = prometheus.NewGaugeFunc(
prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "mvcc",
Name: "db_total_size_in_bytes",
Help: "Total size of the underlying database physically allocated in bytes.",
},
func() float64 {
reportDbTotalSizeInBytesMu.RLock()
defer reportDbTotalSizeInBytesMu.RUnlock()
@ -169,12 +185,13 @@ var (
reportDbTotalSizeInBytesMu sync.RWMutex
reportDbTotalSizeInBytes = func() float64 { return 0 }
dbTotalSizeInUse = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "mvcc",
Name: "db_total_size_in_use_in_bytes",
Help: "Total size of the underlying database logically in use in bytes.",
},
dbTotalSizeInUse = prometheus.NewGaugeFunc(
prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "mvcc",
Name: "db_total_size_in_use_in_bytes",
Help: "Total size of the underlying database logically in use in bytes.",
},
func() float64 {
reportDbTotalSizeInUseInBytesMu.RLock()
defer reportDbTotalSizeInUseInBytesMu.RUnlock()
@ -185,12 +202,13 @@ var (
reportDbTotalSizeInUseInBytesMu sync.RWMutex
reportDbTotalSizeInUseInBytes = func() float64 { return 0 }
dbOpenReadTxN = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "mvcc",
Name: "db_open_read_transactions",
Help: "The number of currently open read transactions",
},
dbOpenReadTxN = prometheus.NewGaugeFunc(
prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "mvcc",
Name: "db_open_read_transactions",
Help: "The number of currently open read transactions",
},
func() float64 {
reportDbOpenReadTxNMu.RLock()
@ -226,12 +244,13 @@ var (
Buckets: prometheus.ExponentialBuckets(.01, 2, 15),
})
currentRev = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Namespace: "etcd_debugging",
Subsystem: "mvcc",
Name: "current_revision",
Help: "The current revision of store.",
},
currentRev = prometheus.NewGaugeFunc(
prometheus.GaugeOpts{
Namespace: "etcd_debugging",
Subsystem: "mvcc",
Name: "current_revision",
Help: "The current revision of store.",
},
func() float64 {
reportCurrentRevMu.RLock()
defer reportCurrentRevMu.RUnlock()