From c48a0adad0c57eff5cf32448dbb8fbe21e65fd36 Mon Sep 17 00:00:00 2001 From: "Marcelo E. Magallon" Date: Wed, 31 Mar 2021 13:08:36 -0600 Subject: [PATCH] fixup! Add support for decompression of HTTP responses Signed-off-by: Marcelo E. Magallon --- prober/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prober/http.go b/prober/http.go index 31f22c6d..67a7c299 100644 --- a/prober/http.go +++ b/prober/http.go @@ -477,7 +477,7 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr if httpConfig.Compression != "" { dec, err := getDecompressionReader(httpConfig.Compression, resp.Body) if err != nil { - level.Info(logger).Log("msg", "Failed to get decompressor for HTTP response body", "err", err.Error()) + level.Info(logger).Log("msg", "Failed to get decompressor for HTTP response body", "err", err) success = false } else if dec != nil { // Since we are replacing the original resp.Body with the decoder, we need to make sure @@ -488,7 +488,7 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr if err != nil { // At this point we cannot really do anything with this error, but log // it in case it contains useful information as to what's the problem. - level.Info(logger).Log("msg", "Error while closing response from server", "error", err.Error()) + level.Info(logger).Log("msg", "Error while closing response from server", "err", err) } }(resp.Body)