mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-24 08:46:54 +08:00
remove all (currently existing) collection volume metrics
This commit is contained in:
@@ -17,6 +17,16 @@ import (
|
||||
"github.com/prometheus/client_golang/prometheus/push"
|
||||
)
|
||||
|
||||
// Readonly volume types
|
||||
const (
|
||||
IsReadOnly = "IsReadOnly"
|
||||
NoWriteOrDelete = "noWriteOrDelete"
|
||||
NoWriteCanDelete = "noWriteCanDelete"
|
||||
IsDiskSpaceLow = "isDiskSpaceLow"
|
||||
)
|
||||
|
||||
var readOnlyVolumeTypes = [4]string{IsReadOnly, NoWriteOrDelete, NoWriteCanDelete, IsDiskSpaceLow}
|
||||
|
||||
var (
|
||||
Gather = prometheus.NewRegistry()
|
||||
|
||||
@@ -249,3 +259,11 @@ func SourceName(port uint32) string {
|
||||
}
|
||||
return net.JoinHostPort(hostname, strconv.Itoa(int(port)))
|
||||
}
|
||||
|
||||
func DeleteCollectionMetrics(collection string) {
|
||||
VolumeServerDiskSizeGauge.DeleteLabelValues(collection, "normal")
|
||||
for _, volume_type := range readOnlyVolumeTypes {
|
||||
VolumeServerReadOnlyVolumeGauge.DeleteLabelValues(collection, volume_type)
|
||||
}
|
||||
VolumeServerVolumeCounter.DeleteLabelValues(collection, "volume")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user