Skip to content

Commit

Permalink
fix(outputs.loki): Do not close body before reading it (influxdata#14604
Browse files Browse the repository at this point in the history
)
  • Loading branch information
powersj authored and hhiroshell committed Feb 1, 2024
1 parent d7b9ec7 commit 7b2f4c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/outputs/loki/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (l *Loki) writeMetrics(s Streams) error {
if err != nil {
return err
}
_ = resp.Body.Close()
defer resp.Body.Close()

if resp.StatusCode < 200 || resp.StatusCode >= 300 {
body, _ := io.ReadAll(resp.Body)
Expand Down

0 comments on commit 7b2f4c4

Please sign in to comment.