[ClrProfiler] Guarantee that startup hook only runs at one callsite in IIS applications#775
Merged
Merged
Conversation
…tup hook is only inserted in the System.Web.Compilation.BuildManager.InvokePreStartInitMethods. This means ancillary app domain's created by the application will not be instrumented, but this proves safer and such instrumented methods would be disconnected from incoming requests anyways as the Tracer instance would be separate if that automatic instrumentation actually happened.
… covers the case where an ASP.NET Core site is hosted in-process and ensures the startup hook runs inside that application to receive ASP.NET Core traces.
lucaspimentel
approved these changes
Jul 1, 2020
lucaspimentel
left a comment
Member
There was a problem hiding this comment.
More startup hook madness!
…ged Loader doesn't cause another startup hook insertion itself
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
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.
Modify the profiler so that, when running IIS or IIS Express on .NET Framework, the startup hook is only inserted in the
System.Web.Compilation.BuildManager.InvokePreStartInitMethods. This has the following effects:System.Web.Compilation.BuildManager.InvokePreStartInitMethodswas called out as a valid callsite, but it was possible for other modules to be loaded and methods to be called before this, causing the startup logic to run in the incorrect place.@DataDog/apm-dotnet