-
-
Notifications
You must be signed in to change notification settings - Fork 105
Fix io_loop span #445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix io_loop span #445
Conversation
|
Thanks for looking into it! |
|
Ha, yes sorry 🙈 |
|
Done! |
|
Also, is there any chance we could get this backported to 2.x and/or 3.x? |
| tracing::span!(Level::TRACE, "io_loop") | ||
| }; | ||
| span.follows_from(&connect_span); | ||
| span |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe all of this could be replaced with something like
let span_level = connect_span.metadata().map_or(Level::TRACE, |metadata| metadata.level());
tracing::span!(parent: connect_span, span_level, "io_loop")
Also, if you target the lapin-2.x branch instead, I'll cut a release for it, then merge in newer branch and cut 3.x and 4.x releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few things:
-
Span level – This can't be dynamic, otherwise yeah that approach would be better! You get this error:
attempt to use a non-constant value in a constant non-constant valueWhich has serious "how much wood would a woodchuck chuck..." vibes.
Yeah, this is a kind of annoying limitation of
tracing. -
Relationship with connect span – I decided not to set the connect span as the parent. See the docs from
tracing:In addition to having zero or one parent, a span may also follow from any number of other spans. This indicates a causal relationship between the span and the spans that it follows from, but a follower is not typically considered part of the duration of the span it follows.
Which seems to match what we're trying to represent here.
-
Branch target – Grand, I can change that 👍
|
Oh good lord changing the target in GitHub did horrible things. Let me fix that 😅 |
So it doesn't keep the current span alive for the lifetime of the connection.
307fc93 to
9e07abd
Compare
Fixes #444
This way, we don't keep the application's connect span alive for the lifetime of the connection, but we do keep the same log level.