mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
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:
This commit is contained in:
parent
725f8d35dd
commit
b4e02ec525
|
@ -3,11 +3,13 @@ package stats
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/prometheus/client_golang/prometheus/push"
|
"github.com/prometheus/client_golang/prometheus/push"
|
||||||
|
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -119,7 +121,7 @@ func LoopPushingMetric(name, instance string, gatherer *prometheus.Registry, fnG
|
||||||
for {
|
for {
|
||||||
if currentAddr != "" {
|
if currentAddr != "" {
|
||||||
err := pusher.Push()
|
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)
|
glog.V(0).Infof("could not push metrics to prometheus push gateway %s: %v", addr, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue