forked from DataDog/dd-trace-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load CLR profiler assembly per AppDomain (DataDog#510)
Product changes: - Introduce new map data structures in the profiler to keep track of which app domain's the profiler has been loaded into and which ones have run the startup IL code, and use them to determine if it is safe to instrument a caller method based on its AppDomain. - Edit MSI to install net45 assets into GAC. This is necessary because we still run into "security grant" issue when the assembly to instrument is domain-neutral and our profiler assembly is not. Testing changes: - Refactor AppDomain.Instance program to easily run subprograms to test how integrations are instrumented while run in different AppDomain's. The original subprogram is `SqlServerNestedProgram`. Add a new `ElasticsearchNestedProgram` subprogram with wrapper sample `Samples.Elasticsearch.MultipleAppDomains`, but it is not running in CI because we haven't figured out how to run Elasticsearch in Windows CI on Azure DevOps Notes: - As noted with the MSI, we still must have the profiler in the GAC in order to load as a domain-neutral assembly and avoid the "security grant" issue.
- Loading branch information
1 parent
8d51978
commit 2134d7a
Showing
17 changed files
with
511 additions
and
205 deletions.
There are no files selected for viewing
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
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
12 changes: 11 additions & 1 deletion
12
reproduction-dependencies/AppDomain.Instance/AppDomain.Instance.csproj
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Library</OutputType> | ||
<OutputType>Exe</OutputType> | ||
<TargetFrameworks>net45</TargetFrameworks> | ||
<Platforms>x64;x86</Platforms> | ||
<PlatformTarget>$(Platform)</PlatformTarget> | ||
<IsPackable>false</IsPackable> | ||
<LoadManagedProfilerFromProfilerDirectory>true</LoadManagedProfilerFromProfilerDirectory> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Elasticsearch.Net" Version="6.1.0" /> | ||
<PackageReference Include="NEST" Version="6.1.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="System.Net.Http" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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
Oops, something went wrong.