diff options
| author | Evgeny Kuzhelev <askeipx@gmail.com> | 2022-07-27 16:31:49 +0500 |
|---|---|---|
| committer | Evgeny Kuzhelev <askeipx@gmail.com> | 2022-07-27 16:31:49 +0500 |
| commit | 47c72e6f3562bdf8566effd38c911285ba955eb4 (patch) | |
| tree | d814ac7431664bb1ac252e4fca32779e0e7e5a0f /weed/stats/metrics.go | |
| parent | 709c83716cbc1877510d0836ab1194eb28c99761 (diff) | |
| download | seaweedfs-47c72e6f3562bdf8566effd38c911285ba955eb4.tar.xz seaweedfs-47c72e6f3562bdf8566effd38c911285ba955eb4.zip | |
remove all (currently existing) collection volume metrics
Diffstat (limited to 'weed/stats/metrics.go')
| -rw-r--r-- | weed/stats/metrics.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/weed/stats/metrics.go b/weed/stats/metrics.go index f0b810608..0f4fcfb52 100644 --- a/weed/stats/metrics.go +++ b/weed/stats/metrics.go @@ -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") +} |
