ensure current tracing span is passed into streaming html rewrite#2974
Merged
syphar merged 1 commit intorust-lang:masterfrom Nov 4, 2025
Merged
ensure current tracing span is passed into streaming html rewrite#2974syphar merged 1 commit intorust-lang:masterfrom
syphar merged 1 commit intorust-lang:masterfrom
Conversation
syphar
commented
Nov 3, 2025
4904cc3 to
1b9711b
Compare
GuillaumeGomez
approved these changes
Nov 3, 2025
Member
|
Feel free to merge once merge conflicts have been fixed. |
1b9711b to
b8cf593
Compare
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.
Here I'm trying again to fix this.
Problem is: when we emit log-messages from inside the stream, or sentry errors, these don't contain any information from the parent spans. For example on this sentry we can't really see which crate is affected.
The initially obvious solution was #2874, where I use
Span::enterand the guard object.Some reading and testing made me understand where the memory leak was coming from. Generally the guard object coming from
Span::entershould never be held across await-points. Which I did since I was holding onto it for the whole stream.The solution is to use the async-capable alternative, which is annotating the future with
.instrument(span). The newtracing-futuresdependency is needed so we can directly annotate the stream.Additionally I did forget to pass the span info into our
render_in_threadpoolclojures.