aboutsummaryrefslogtreecommitdiff
path: root/weed/stats/metrics.go
diff options
context:
space:
mode:
authorJonas Falck <jonas.falck@fortnox.se>2021-06-22 09:54:13 +0200
committerJonas Falck <jonas.falck@fortnox.se>2021-06-22 13:09:42 +0200
commit829b195084274309bd10c5d87ecf31513db7176e (patch)
tree7c3af23dc28a2db3f69a1613ddf7bf934fda8cd1 /weed/stats/metrics.go
parent117f8e0bc14ba7d5a29d397d02e2cd15f8eb1ab0 (diff)
downloadseaweedfs-829b195084274309bd10c5d87ecf31513db7176e.tar.xz
seaweedfs-829b195084274309bd10c5d87ecf31513db7176e.zip
Add process metrics of weed itself
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)
-
}
}