-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
refac: move ID rewriting to console
#244
Merged
Merged
Conversation
This file contains 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
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
zaharidichev
approved these changes
Dec 28, 2021
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.
LGTM, and yes this makes a lot of sense!
hawkw
added a commit
that referenced
this pull request
Jan 6, 2022
PR #244 moved the rewriting of `tracing` span IDs to sequential low-number IDs from the `console-subscriber` crate to the console CLI. However, this introduced a bug with task details, because that PR didn't change the part of the console that makes `watch_details` RPCs to use the `tracing` span ID recieved from the remote --- it continued to use the `Task` and `Resource` structs' `id` fields. These are now different from the `tracing` ID recieved from the remote, because they're rewritten in the console CLI. This means that `watch_details` RPCs would generally recieve an error, or (in the off-chance that a rewritten ID collides with a low-numbered `tracing` ID) the details for anoter task or resource. This branch fixes the bug by changing the `Task` and `Resource` structs to store both the span ID received from the remote _and_ the rewritten pretty ID. This way, when we make `watch_details` RPC calls, we do it with the span ID we received from the remote process. I also changed some naming to make the distinction between rewritten IDs and span IDs clearer.
hawkw
added a commit
that referenced
this pull request
Jan 7, 2022
## Motivation PR #244 moved the rewriting of `tracing` span IDs to sequential low-number IDs from the `console-subscriber` crate to the console CLI. However, this introduced a bug with task details, because that PR didn't change the part of the console that makes `watch_details` RPCs to use the `tracing` span ID recieved from the remote --- it continued to use the `Task` and `Resource` structs' `id` fields. These are now different from the `tracing` ID recieved from the remote, because they're rewritten in the console CLI. This means that `watch_details` RPCs would generally recieve an error, or (in the off-chance that a rewritten ID collides with a low-numbered `tracing` ID) the details for anoter task or resource. ## Solution This branch fixes the bug by changing the `Task` and `Resource` structs to store both the span ID received from the remote _and_ the rewritten pretty ID. This way, when we make `watch_details` RPC calls, we do it with the span ID we received from the remote process. I also changed some naming to make the distinction between rewritten IDs and span IDs clearer.
hawkw
pushed a commit
that referenced
this pull request
Jan 10, 2022
#244 moved rewriting of ids to the console. We have however forgot to look up the pretty ID when trying to figure out which task is running a particular async op. The result of that was that we were displaying the raw ID for the task and we were not able to properly resolve the name of the task if specified. Before: <img width="838" alt="Screenshot 2022-01-09 at 19 52 27" src="https://user-images.githubusercontent.com/4391506/148694237-1d9b995c-a99a-42d8-865d-2af638524582.png"> After: <img width="861" alt="Screenshot 2022-01-09 at 19 53 24" src="https://user-images.githubusercontent.com/4391506/148694247-9af70d61-6b8b-4bca-bdcb-63c1a0a334f9.png"> Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
hawkw
added a commit
that referenced
this pull request
Jan 18, 2022
hawkw
added a commit
that referenced
this pull request
Jan 18, 2022
<a name="0.1.1"></a> ## 0.1.1 (2022-01-18) #### Bug Fixes * only send *new* tasks/resources/etc over the event channel (#238) ([fdc77e2](fdc77e2)) * increased default event buffer capacity (#235) ([0cf0aee](0cf0aee)) * use saturating arithmetic for attribute updates (#234) ([fe82e17](fe82e17)) #### Changes * moved ID rewriting from `console-subscriber` to the client (#244) ([095b1ef](095b1ef)) ## 0.1.0 (2021-12-16) - Initial release! 🎉
hawkw
added a commit
that referenced
this pull request
Jan 18, 2022
<a name="0.1.1"></a> ## 0.1.1 (2022-01-18) #### Bug Fixes * only send *new* tasks/resources/etc over the event channel (#238) ([fdc77e2](fdc77e2)) * increased default event buffer capacity (#235) ([0cf0aee](0cf0aee)) * use saturating arithmetic for attribute updates (#234) ([fe82e17](fe82e17)) #### Changes * moved ID rewriting from `console-subscriber` to the client (#244) ([095b1ef](095b1ef)) ## 0.1.0 (2021-12-16) - Initial release! 🎉
hawkw
added a commit
that referenced
this pull request
Jan 18, 2022
<a name="0.1.1"></a> ## 0.1.1 (2022-01-18) #### Bug Fixes * only send *new* tasks/resources/etc over the event channel (#238) ([fdc77e2](fdc77e2)) * increased default event buffer capacity (#235) ([0cf0aee](0cf0aee)) * use saturating arithmetic for attribute updates (#234) ([fe82e17](fe82e17)) #### Changes * moved ID rewriting from `console-subscriber` to the client (#244) ([095b1ef](095b1ef))
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.
Currently,
console-subscriber
contains a bunch of machinery forrewriting non-sequential
span::Id
s fromtracing
to sequential IDs(see #75). Upon thinking about this for a bit, I don't actually
understand why this has to be done on the instrumentation-side. This
seems like extra work that's currently done in the instrumented
application, when it really doesn't have to be.
Instead, the client should be responsible for rewriting
tracing
IDs topretty, sequential user-facing IDs. This would have a few advantages:
console-subscriber
, we will still get nicely ordered idsThis branch removes ID rewriting from
console-subscriber
, and adds itto the
console
CLI'sstate
module.Closes #240