From 092e2c8f2da5e922ac97b65355528f0c8ac76bb5 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sun, 15 Jan 2023 14:06:38 -0800 Subject: [PATCH] github.com/VictoriaMetrics/metrics: update from v1.23.0 to v1.23.1 See https://github.com/VictoriaMetrics/metrics/issues/42 --- go.mod | 2 +- go.sum | 4 ++-- .../VictoriaMetrics/metrics/process_metrics_linux.go | 12 +++++++++++- vendor/modules.txt | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index bc76ff8c9..0d415df7b 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( // Do not use the original github.com/valyala/fasthttp because of issues // like https://github.com/valyala/fasthttp/commit/996610f021ff45fdc98c2ce7884d5fa4e7f9199b github.com/VictoriaMetrics/fasthttp v1.1.0 - github.com/VictoriaMetrics/metrics v1.23.0 + github.com/VictoriaMetrics/metrics v1.23.1 github.com/VictoriaMetrics/metricsql v0.51.1 github.com/aws/aws-sdk-go-v2 v1.17.3 github.com/aws/aws-sdk-go-v2/config v1.18.8 diff --git a/go.sum b/go.sum index 1560eef4e..cac65b52e 100644 --- a/go.sum +++ b/go.sum @@ -67,8 +67,8 @@ github.com/VictoriaMetrics/fastcache v1.12.0/go.mod h1:tjiYeEfYXCqacuvYw/7UoDIeJ github.com/VictoriaMetrics/fasthttp v1.1.0 h1:3crd4YWHsMwu60GUXRH6OstowiFvqrwS4a/ueoLdLL0= github.com/VictoriaMetrics/fasthttp v1.1.0/go.mod h1:/7DMcogqd+aaD3G3Hg5kFgoFwlR2uydjiWvoLp5ZTqQ= github.com/VictoriaMetrics/metrics v1.18.1/go.mod h1:ArjwVz7WpgpegX/JpB0zpNF2h2232kErkEnzH1sxMmA= -github.com/VictoriaMetrics/metrics v1.23.0 h1:WzfqyzCaxUZip+OBbg1+lV33WChDSu4ssYII3nxtpeA= -github.com/VictoriaMetrics/metrics v1.23.0/go.mod h1:rAr/llLpEnAdTehiNlUxKgnjcOuROSzpw0GvjpEbvFc= +github.com/VictoriaMetrics/metrics v1.23.1 h1:/j8DzeJBxSpL2qSIdqnRFLvQQhbJyJbbEi22yMm7oL0= +github.com/VictoriaMetrics/metrics v1.23.1/go.mod h1:rAr/llLpEnAdTehiNlUxKgnjcOuROSzpw0GvjpEbvFc= github.com/VictoriaMetrics/metricsql v0.51.1 h1:gmh3ZGCDrqUTdhUrr87eJOXMOputDYs1PtLwTfySTsI= github.com/VictoriaMetrics/metricsql v0.51.1/go.mod h1:6pP1ZeLVJHqJrHlF6Ij3gmpQIznSsgktEcZgsAWYel0= github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= diff --git a/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go b/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go index 005af82f3..48def1cba 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go +++ b/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go @@ -9,6 +9,7 @@ import ( "os" "strconv" "strings" + "sync/atomic" "time" ) @@ -48,6 +49,7 @@ func writeProcessMetrics(w io.Writer) { log.Printf("ERROR: metrics: cannot open %s: %s", statFilepath, err) return } + // Search for the end of command. n := bytes.LastIndex(data, []byte(") ")) if n < 0 { @@ -85,12 +87,20 @@ func writeProcessMetrics(w io.Writer) { writeIOMetrics(w) } +var procSelfIOErrLogged uint32 + func writeIOMetrics(w io.Writer) { ioFilepath := "/proc/self/io" data, err := ioutil.ReadFile(ioFilepath) if err != nil { - log.Printf("ERROR: metrics: cannot open %q: %s", ioFilepath, err) + // Do not spam the logs with errors - this error cannot be fixed without process restart. + // See https://github.com/VictoriaMetrics/metrics/issues/42 + if atomic.CompareAndSwapUint32(&procSelfIOErrLogged, 0, 1) { + log.Printf("ERROR: metrics: cannot read process_io_* metrics from %q, so these metrics won't be updated until the error is fixed; "+ + "see https://github.com/VictoriaMetrics/metrics/issues/42 ; The error: %s", ioFilepath, err) + } } + getInt := func(s string) int64 { n := strings.IndexByte(s, ' ') if n < 0 { diff --git a/vendor/modules.txt b/vendor/modules.txt index 3560ee519..e5ef3fb54 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -67,7 +67,7 @@ github.com/VictoriaMetrics/fastcache github.com/VictoriaMetrics/fasthttp github.com/VictoriaMetrics/fasthttp/fasthttputil github.com/VictoriaMetrics/fasthttp/stackless -# github.com/VictoriaMetrics/metrics v1.23.0 +# github.com/VictoriaMetrics/metrics v1.23.1 ## explicit; go 1.15 github.com/VictoriaMetrics/metrics # github.com/VictoriaMetrics/metricsql v0.51.1