aboutsummaryrefslogtreecommitdiff
path: root/weed/stats/metrics.go
diff options
context:
space:
mode:
authorBl1tz23 <alex3angle@gmail.com>2021-08-10 13:45:24 +0300
committerBl1tz23 <alex3angle@gmail.com>2021-08-10 13:45:24 +0300
commit1c94b3d01340baad000188550fcf2ccab6ca80e5 (patch)
tree12c3da17eb2d1a43fef78021a3d7c79110b0ff5f /weed/stats/metrics.go
parente6e57db530217ff57b3622b4672b03ebb6313e96 (diff)
parentf9cf9b93d32a2b01bc4d95ce7d24d86ef60be668 (diff)
downloadseaweedfs-1c94b3d01340baad000188550fcf2ccab6ca80e5.tar.xz
seaweedfs-1c94b3d01340baad000188550fcf2ccab6ca80e5.zip
merge master, resolve conflicts
Diffstat (limited to 'weed/stats/metrics.go')
-rw-r--r--weed/stats/metrics.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/weed/stats/metrics.go b/weed/stats/metrics.go
index 3f5d851a4..48d964418 100644
--- a/weed/stats/metrics.go
+++ b/weed/stats/metrics.go
@@ -8,11 +8,11 @@ import (
"strings"
"time"
+ "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/prometheus/client_golang/prometheus"
+ "github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/client_golang/prometheus/push"
-
- "github.com/chrislusf/seaweedfs/weed/glog"
)
var (
@@ -127,12 +127,12 @@ var (
)
func init() {
-
Gather.MustRegister(FilerRequestCounter)
Gather.MustRegister(FilerRequestHistogram)
Gather.MustRegister(FilerStoreCounter)
Gather.MustRegister(FilerStoreHistogram)
- Gather.MustRegister(prometheus.NewGoCollector())
+ Gather.MustRegister(collectors.NewGoCollector())
+ Gather.MustRegister(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}))
Gather.MustRegister(VolumeServerRequestCounter)
Gather.MustRegister(VolumeServerRequestHistogram)
@@ -147,7 +147,6 @@ func init() {
}
func LoopPushingMetric(name, instance, addr string, intervalSeconds int) {
-
if addr == "" || intervalSeconds == 0 {
return
}
@@ -165,7 +164,6 @@ func LoopPushingMetric(name, instance, addr string, intervalSeconds int) {
intervalSeconds = 15
}
time.Sleep(time.Duration(intervalSeconds) * time.Second)
-
}
}