Repository navigation
Fix exporting of very large spans and payloads - #1027
Merged
Merged
Conversation
Deploying logfire-docs with
|
| Latest commit: |
e8c2247
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3d653e54.logfire-docs.pages.dev |
| Branch Preview URL: | https://alex-check-size-in-exporter.logfire-docs.pages.dev |
adriangb
reviewed
Apr 21, 2025
Comment on lines
+35
to
+40
| def _serialize_spans(self, spans: Sequence[ReadableSpan]) -> bytes: | ||
| result = super()._serialize_spans(spans) # type: ignore | ||
| if len(spans) > 1 and len(result) > self.max_body_size: | ||
| # Tell outer RetryFewerSpansSpanExporter to split in half | ||
| raise BodyTooLargeError(len(result), self.max_body_size) | ||
| return result |
Member
There was a problem hiding this comment.
My only piece of feedback is that this could be expensive and that instead of re-serializing we could transform to protobuf and then manipulate the in-memory representation of the protobuf since that's cheap to manipulate and cheap to calculate the size of objects and their children.
Contributor
Author
There was a problem hiding this comment.
Ideally yes, but not really worth it now.
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.
Replaces #1026
Failed to export batch code: 413, reason: Failed to buffer the request body: length limit exceeded. We should try to make this message clearer some other time.