mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-18 21:26:56 +00:00
Export master_disconnections metrics on volume servers. (#9104)
This allows to track connection issues and master failovers in real time via Prometheus metrics. Co-authored-by: Lisandro Pin <lisandro.pin@proton.ch>
This commit is contained in:
co-authored by
Lisandro Pin
parent
0315da9022
commit
6bcacedda9
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/operation"
|
||||
"github.com/seaweedfs/seaweedfs/weed/stats"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
@@ -84,6 +85,7 @@ func (vs *VolumeServer) heartbeat() {
|
||||
time.Sleep(vs.pulsePeriod)
|
||||
}
|
||||
|
||||
stats.VolumeServerMasterDisconnections.WithLabelValues(master.String()).Inc()
|
||||
newLeader = ""
|
||||
vs.store.MasterAddress = ""
|
||||
} else {
|
||||
|
||||
@@ -362,6 +362,14 @@ var (
|
||||
Help: "In flight total upload size.",
|
||||
})
|
||||
|
||||
VolumeServerMasterDisconnections = prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: Namespace,
|
||||
Subsystem: "volumeServer",
|
||||
Name: "master_disconnections",
|
||||
Help: "Number of master server disconnections.",
|
||||
}, []string{"address"})
|
||||
|
||||
S3RequestCounter = prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: Namespace,
|
||||
@@ -528,6 +536,7 @@ func init() {
|
||||
Gather.MustRegister(VolumeServerConcurrentUploadLimit)
|
||||
Gather.MustRegister(VolumeServerInFlightDownloadSize)
|
||||
Gather.MustRegister(VolumeServerInFlightUploadSize)
|
||||
Gather.MustRegister(VolumeServerMasterDisconnections)
|
||||
|
||||
Gather.MustRegister(S3RequestCounter)
|
||||
Gather.MustRegister(S3HandlerCounter)
|
||||
|
||||
Reference in New Issue
Block a user