beats
beats copied to clipboard
Report error response body in HTTP helper
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.