From ea0596d9d8d343078d2a5f21617488660f99b382 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Tue, 18 Oct 2022 19:37:42 +0200 Subject: [PATCH] lib/promscrape/discovery/kubernetes: correctly wrap error (#3250) * lib/promscrape/discovery/kubernetes: correctly wrap error follow-up after 1304824201bd8bb52907431f2b22981cd11e3930 * Update docs/CHANGELOG.md Co-authored-by: Aliaksandr Valialkin --- docs/CHANGELOG.md | 2 +- lib/promscrape/discovery/kubernetes/api_watcher.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index b49591b2f..4c9cd80c1 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -55,7 +55,7 @@ Released at 14-10-2022 * BUGFIX: [vmbackupmanager](https://docs.victoriametrics.com/vmbackupmanager.html): fix deletion of old backups at [Azure blob storage](https://azure.microsoft.com/en-us/products/storage/blobs/). * BUGFIX: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): properly apply regex filters when searching for time series. Previously unexpected time series could be returned from regex filter. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3227). The issue was introduced in [v1.82.0](https://docs.victoriametrics.com/CHANGELOG.html#v1820). * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmbagent.html): properly apply `if` section with regex filters. Previously unexpected metrics could be returned from `if` section. The issue was introduced in [v1.82.0](https://docs.victoriametrics.com/CHANGELOG.html#v1820). - +* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): do not show invalid error message in Kubernetes service discovery: `cannot parse WatchEvent json response: EOF`. The invalid error message has been appeared in [v1.82.0](https://docs.victoriametrics.com/CHANGELOG.html#v1820). ## [v1.82.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.82.0) diff --git a/lib/promscrape/discovery/kubernetes/api_watcher.go b/lib/promscrape/discovery/kubernetes/api_watcher.go index 973b10a51..dc152979b 100644 --- a/lib/promscrape/discovery/kubernetes/api_watcher.go +++ b/lib/promscrape/discovery/kubernetes/api_watcher.go @@ -702,7 +702,7 @@ func (uw *urlWatcher) readObjectUpdateStream(r io.Reader) error { var we WatchEvent for { if err := d.Decode(&we); err != nil { - return fmt.Errorf("cannot parse WatchEvent json response: %s", err) + return fmt.Errorf("cannot parse WatchEvent json response: %w", err) } switch we.Type { case "ADDED", "MODIFIED":