-
Notifications
You must be signed in to change notification settings - Fork 215
Add error-category telemetry to SshTunnelEvent #6321
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
[optional] Wondering if we could make
Runa thin life-cycle wrapper. The current code is a little hard to follow withoutcomein different place to ultimately being used upstream.Something like this:
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.
Taking a look, this isn't quite the two-line move it appears to be, so I'd rather not fold it into this PR.
Threading
outcomeout through aconnectreturn means touching all 24returnstatements in the currentRunbody, not just the 13 that set a category. It also changes the shape of the telemetry helpers:connectOutcome.errfolds into a newlogSshTunnelEventparameter, which in turn touchescategory()(it readso.errfor both thecontext.Canceledprecedence and theUNKNOWNfallback) and thebuildSshTunnelEventunit tests that assert on it.One detail on the sketch: the signal handler between
cancel()and the defer would need to stay inRun, sinceUSER_ABORTEDdepends on thecontext.Canceledit produces.I don't disagree with the shape you're describing -- splitting the lifecycle from the flow does read better, and you're right that
outcomebeing written in ~13 places and read in one is the awkward part. It's just a wide enough mechanical change that I'd rather keep it out of the commit that adds the field, per the repo's guidance on not mixing refactors with content changes. Happy to do it as a follow-up if you'd like.