Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

fix prometheus problem

Chris Lub4e02ec525a6
diff --git a/weed/stats/metrics.go b/weed/stats/metrics.go
index ee8763e84d..7ff09a3884 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)
}
}