Skip to content

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.

metrics stats of volume layout depends on the data center (#5775)

Konstantin Lebedev33964fa29222
diff --git a/weed/stats/metrics.go b/weed/stats/metrics.go
index 4393c280c0..faf87ff096 100644
--- a/weed/stats/metrics.go
+++ b/weed/stats/metrics.go
@@ -76,7 +76,7 @@ var (
Subsystem: "master",
Name: "volume_layout_total",
Help: "Number of volumes in volume layouts",
- }, []string{"collection", "replica", "type"})
+ }, []string{"collection", "dataCenter", "type"})
MasterLeaderChangeCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.go
index 66f7118c98..f2c341b7c7 100644
--- a/weed/topology/volume_layout.go
+++ b/weed/topology/volume_layout.go
@@ -356,9 +356,9 @@ func (vl *VolumeLayout) DoneGrowRequest() {
func (vl *VolumeLayout) ShouldGrowVolumes(option *VolumeGrowOption) bool {
total, active, crowded := vl.GetActiveVolumeCount(option)
- stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.ReplicaPlacement.String(), "total").Set(float64(total))
- stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.ReplicaPlacement.String(), "active").Set(float64(active))
- stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.ReplicaPlacement.String(), "crowded").Set(float64(crowded))
+ stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.DataCenter, "total").Set(float64(total))
+ stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.DataCenter, "active").Set(float64(active))
+ stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.DataCenter, "crowded").Set(float64(crowded))
//glog.V(0).Infof("active volume: %d, high usage volume: %d\n", active, high)
return active <= crowded
}