fix(outputs.loki): return response body on error (#12399)
This commit is contained in:
parent
02699341e7
commit
754ab64959
|
|
@ -180,7 +180,8 @@ func (l *Loki) writeMetrics(s Streams) error {
|
|||
_ = resp.Body.Close()
|
||||
|
||||
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
|
||||
return fmt.Errorf("when writing to [%s] received status code: %d", l.url, resp.StatusCode)
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
return fmt.Errorf("when writing to [%s] received status code, %d: %s", l.url, resp.StatusCode, body)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue