Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Initial Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nniehoff committed Sep 8, 2021
1 parent 3112416 commit f74a4b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.19.2-ntc-1
1.19.3-ntc-1
5 changes: 5 additions & 0 deletions plugins/outputs/loki/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ func (l *Loki) write(s Streams) error {
}
_ = resp.Body.Close()

if resp.StatusCode == 400 {
fmt.Sprintf("when writing to loki received status code: 400, body %s, dropping log", resp.Body)
return nil
}

if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return fmt.Errorf("when writing to [%s] received status code: %d", l.url, resp.StatusCode)
}
Expand Down

0 comments on commit f74a4b5

Please sign in to comment.