From 5d86b52d2839f88c0a8d4993a695ca9ab0ec5ccf Mon Sep 17 00:00:00 2001 From: Saswata Mukherjee Date: Fri, 18 Oct 2024 19:50:12 +0530 Subject: [PATCH] Log remote write errors as they happen (#102) Signed-off-by: Saswata Mukherjee --- metrics/write.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/metrics/write.go b/metrics/write.go index 9e0af3f..38808e3 100644 --- a/metrics/write.go +++ b/metrics/write.go @@ -341,9 +341,8 @@ func (c *Client) Store(ctx context.Context, req *prompb.WriteRequest) error { line = scanner.Text() } err = fmt.Errorf("server returned HTTP status %s: %s", httpResp.Status, line) + log.Println(err) } - if httpResp.StatusCode/100 == 5 { - return err - } + return err }