lib/promscrape/discovery/kubernetes: add more context on WatchEvent parse error

This should improve debugging issues with Kubernetes API server
This commit is contained in:
Aliaksandr Valialkin 2022-09-13 19:36:47 +03:00
parent 46e8bd34f7
commit 592612b63f
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -702,7 +702,7 @@ func (uw *urlWatcher) readObjectUpdateStream(r io.Reader) error {
var we WatchEvent
for {
if err := d.Decode(&we); err != nil {
return err
return fmt.Errorf("cannot parse WatchEvent json response: %s", err)
}
switch we.Type {
case "ADDED", "MODIFIED":