fix: say which tracing destination rejected the data - #2714
Open
tonyandrewmeyer wants to merge 2 commits into
Open
fix: say which tracing destination rejected the data#2714tonyandrewmeyer wants to merge 2 commits into
tonyandrewmeyer wants to merge 2 commits into
Conversation
When the OTLP collector responds with an HTTP error, include the destination URL in the log line, drop the traceback (the status code is enough on its own), and read at most 1000 bytes from the response body rather than reading all of it and slicing afterwards.
pyright, run from the tracing directory, rejects a bare dict for the hdrs argument.
tonyandrewmeyer
marked this pull request as ready for review
August 31, 2026 01:20
dwilding
approved these changes
Sep 3, 2026
dwilding
left a comment
Contributor
There was a problem hiding this comment.
The logic makes sense to me, thanks!
| 503, | ||
| 'Service Unavailable', | ||
| email.message.Message(), | ||
| io.BytesIO(long_body), # type: ignore[arg-type] |
Contributor
There was a problem hiding this comment.
tox -e lint passes even without the type ignore. Shall we drop it?
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.
When the collector rejects an export, the log line says the status code but not which destination it came from, and it goes through
logger.exception, so you get a full traceback for something the status code already explains. This addsconfig.urlto the message, drops tologger.error, and reads at most 1000 bytes of the response body rather than reading all of it and slicing afterwards, so a verbose collector can't make us buffer megabytes we're about to throw away.I went with
errorrather thanwarningbecause the previous call wasexceptionand we do lose the batch, but tracing is best-effort.Fixes #2137