SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
add number of read only volumes metric
Konstantin Lebedevdc2e13092da9
diff --git a/weed/stats/metrics.go b/weed/stats/metrics.goindex a60cda2907..13ab3bae12 100644--- a/weed/stats/metrics.go+++ b/weed/stats/metrics.go@@ -77,6 +77,14 @@ var (Help: "Number of volumes or shards.",}, []string{"collection", "type"})+ VolumeServerReadOnlyVolumeGauge = prometheus.NewGaugeVec(+ prometheus.GaugeOpts{+ Namespace: "SeaweedFS",+ Subsystem: "volumeServer",+ Name: "read_only_volumes",+ Help: "Number of read only volumes.",+ }, []string{"collection", "type"})+VolumeServerMaxVolumeCounter = prometheus.NewGauge(prometheus.GaugeOpts{Namespace: "SeaweedFS",@@ -122,6 +130,7 @@ func init() {Gather.MustRegister(VolumeServerRequestHistogram)Gather.MustRegister(VolumeServerVolumeCounter)Gather.MustRegister(VolumeServerMaxVolumeCounter)+ Gather.MustRegister(VolumeServerReadOnlyVolumeGauge)Gather.MustRegister(VolumeServerDiskSizeGauge)Gather.MustRegister(S3RequestCounter)diff --git a/weed/storage/store.go b/weed/storage/store.goindex d5d59235ad..72a3883795 100644--- a/weed/storage/store.go+++ b/weed/storage/store.go@@ -200,6 +200,7 @@ func (s *Store) CollectHeartbeat() *master_pb.Heartbeat {maxVolumeCount := 0var maxFileKey NeedleIdcollectionVolumeSize := make(map[string]uint64)+ collectionVolumeReadOnlyCount := make(map[string]uint8)for _, location := range s.Locations {var deleteVids []needle.VolumeIdmaxVolumeCount = maxVolumeCount + location.MaxVolumeCount@@ -219,6 +220,9 @@ func (s *Store) CollectHeartbeat() *master_pb.Heartbeat {}fileSize, _, _ := v.FileStat()collectionVolumeSize[v.Collection] += fileSize+ if v.IsReadOnly() {+ collectionVolumeReadOnlyCount[v.Collection] += 1+ }}location.volumesLock.RUnlock()@@ -243,6 +247,10 @@ func (s *Store) CollectHeartbeat() *master_pb.Heartbeat {stats.VolumeServerDiskSizeGauge.WithLabelValues(col, "normal").Set(float64(size))}+ for col, count := range collectionVolumeReadOnlyCount {+ stats.VolumeServerReadOnlyVolumeGauge.WithLabelValues(col, "normal").Set(float64(count))+ }+return &master_pb.Heartbeat{Ip: s.Ip,Port: uint32(s.Port),