Skip to content

Commit

Permalink
Log errors from loki (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
outofforest authored Jul 26, 2024
1 parent 99e668c commit 6227033
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,7 @@ loop:
return errors.WithStack(err)
}

switch resp.StatusCode {
case http.StatusBadRequest:
log.Error("Received Bad Request response from loki", zap.ByteString("body", body))
default:
return errors.Errorf("unexpected response from loki endpoint, code: %d, body: %s", resp.StatusCode, body)
}
return errors.Errorf("unexpected response from loki endpoint, code: %d, body: %s", resp.StatusCode, body)
}

return nil
Expand All @@ -258,6 +253,8 @@ loop:
return nil
}

log.Error("Received error from Loki", zap.Error(err))

select {
case <-ctx.Done():
return errors.WithStack(ctx.Err())
Expand Down

0 comments on commit 6227033

Please sign in to comment.