diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-05-14 21:08:34 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-05-14 21:08:34 -0700 |
| commit | b4e02ec525a6ec87b26686202307896faf3296a7 (patch) | |
| tree | 048654a311f1d5c50e2d44576fba0ee8098fe9db /weed/stats/metrics.go | |
| parent | 725f8d35dd9e239c3ca325b10fef1b8ed5311e59 (diff) | |
| download | seaweedfs-b4e02ec525a6ec87b26686202307896faf3296a7.tar.xz seaweedfs-b4e02ec525a6ec87b26686202307896faf3296a7.zip | |
fix prometheus problem
metrics.go:123] could not push metrics to prometheus push gateway 192.168.xx:9091: unexpected status code 200 while pushing to http://192.168.xx:9091/metrics/job/filer/instance/m111p112%3A8888:
Diffstat (limited to 'weed/stats/metrics.go')
| -rw-r--r-- | weed/stats/metrics.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/stats/metrics.go b/weed/stats/metrics.go index ee8763e84..7ff09a388 100644 --- a/weed/stats/metrics.go +++ b/weed/stats/metrics.go @@ -3,11 +3,13 @@ package stats import ( "fmt" "os" + "strings" "time" - "github.com/chrislusf/seaweedfs/weed/glog" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/push" + + "github.com/chrislusf/seaweedfs/weed/glog" ) var ( @@ -119,7 +121,7 @@ func LoopPushingMetric(name, instance string, gatherer *prometheus.Registry, fnG for { if currentAddr != "" { err := pusher.Push() - if err != nil { + if err != nil && !strings.HasPrefix(err.Error(), "unexpected status code 200") { glog.V(0).Infof("could not push metrics to prometheus push gateway %s: %v", addr, err) } } |
