Repository navigation
Report a batch Better Stack rejected instead of dropping it silently - #64
Merged
Merged
Conversation
…HTTP status A 4xx answer (a wrong source token, a payload too large) drops the batch without retrying it, and today without a word. These tests pin one printed line per rejecting status, with the server's reason, and no retry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A batch answered with a non-2xx status other than a 5xx is not retried, and until now it was dropped without a word, so an app with a wrong source token saw no sign that none of its logs arrived. The flush worker now prints one line per HTTP status with the number of records dropped, the status and the start of the server's answer, the way it reports a batch whose retries ran out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LogtailHandlerretries a batch that Better Stack answers with a 5xx (or that hits a network error) and printsFailed to send logs to Better Stack after 3 retries: ...when the retries run out. A batch answered with any other non-2xx status is rightly not retried, but it is also dropped without a word: nothing is printed, nothing is raised anddropcountstays the same. An app with a wrong or revoked source token (401), or one sending a payload that is too large (413) or malformed (400, 422), gets no sign that none of its logs arrive.With this change the flush worker reports such a batch through the same
print()as the 5xx path:The first commit adds only the tests and is expected to fail CI.
🤖 Generated with Claude Code