-
Notifications
You must be signed in to change notification settings - Fork 287
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
Minor perf improvements.. #1170
Conversation
|
||
if (string.IsNullOrEmpty(instrumentationKey)) | ||
{ | ||
instrumentationKey = this.configuration.InstrumentationKey; |
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 remember keeping this assignment outside to make sure that proactively sampled out item won't get "Invalid Ikey" or won't get dropped before it arrives to sampling for gain up calculation in Sampling Telemetry Processor. If we are sure that items make it all the way without IKey - this change is OK. There was a case where setting empty IKey prevented all telemetry from leaving SDK (I may have false memory here, though).
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.
The lines i moved into the if block will not have helped with the issue. It just assigns ikey to a local variable, which is ONLY used inside the if block. I just moved the assignment closer to actual usage, in the same if block.
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.
https://github.com/microsoft/ApplicationInsights-aspnetcore/blob/develop/src/Microsoft.ApplicationInsights.AspNetCore/DiagnosticListeners/Implementation/HostingDiagnosticListener.cs#L513 This initialization is probably what you are referring to. That assignment is outside of any Sampling If-Else statements, and is correctly done so,
Fix Issue # .
For significant contributions please make sure you have completed the following items:
Design discussion issue #
Changes in public surface reviewed
CHANGELOG.md updated with one line description of the fix, and a link to the original issue.
The PR will trigger build, unit tests, and functional tests automatically. If your PR was submitted from fork - mention one of committers to initiate the build for you.
If you want to to re-run the build/tests, the easiest way is to simply Close and Re-Open this same PR. (Just click 'close pull request' followed by 'open pull request' buttons at the bottom of the PR)
Please follow [these] (https://github.com/Microsoft/ApplicationInsights-dotnet/blob/develop/.github/CONTRIBUTING.md) instructions to build and test locally.