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.
Move telemetry start to earliest point in DeploymentManager public APIs #6319
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
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Move telemetry start to earliest point in DeploymentManager public APIs #6319
Changes from all commits
70172bfFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
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.
Did the original code even work? The Start method constructs and returns the static singleton, which should then be captured via SetActivity for subsequent tracing via GetActivity. See the InstallActivityContext for comparison. In any case, we're foregoing the benefits of using TraceLoggingProvider's nested RAII TraceLoggingActivity with this pattern, instead requiring explicit Stop calls. We could create an RAII wrapper to ensure Stop is called on scope exit, but much simpler to just use TraceLoggingActivity as designed:
{
// activity scope
auto& activity = WindowsAppRuntimeDeployment_TraceLogger::::Start(...);
try
{
// do stuff ...
}
catch
{
activity.StopWithResult(...);
}
// activity goes out of scope, conditionally calls Stop
}
The same goes for WindowsAppRuntimeInstaller_TraceLogger::Install, etc.
This PR is also far too intrusive and obfuscates the real functionality with all the tracing calls. GetStatus_StopSuccessActivity is a good concept to shrink that cognitive overhead. I'd ask the bot to redesign the code to minimize the intrusion, and to leverage RAII.
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.
I agree. This was a first pass attempt at resolving the issue. @agniuks took another try at the issue in this PR: #6323. I'll be reviewing it soon.
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.
With this new try catch, do we still need the one inside the Initialize method?
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.
Is this needed? Can't we just know for sure that telemetry is already started?
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.
RAII should guarantee initilaization
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.
Instead of passing these two bools, we could just use an enum here.
Uh oh!
There was an error while loading. Please reload this page.