beats icon indicating copy to clipboard operation
beats copied to clipboard

Report error response body in HTTP helper

Open miltonhultgren opened this issue 1 year ago • 2 comments

In https://github.com/elastic/beats/blob/main/metricbeat/helper/http.go#L179 we don't report the body of the response when an error happens, making it harder to understand why the particular HTTP request failed. This can sometimes make it harder to capture errors that are transient.

It would be great if we could read the body stream and print that out as well with the error.

miltonhultgren avatar Jun 26 '23 10:06 miltonhultgren