-
Notifications
You must be signed in to change notification settings - Fork 93
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
Instrumentation does not work with dotnet CLI #1744
Comments
I guess it's the same thing as previously was with |
From #1699 (comment)
|
Setting this helped. I think we should consider baking some well known exceptions into our solution. |
SIG: Docker templates are used to do "dotnet myapp.dll", so blocking this command will be problematic. |
@RassK Do you think adding adding a section about |
Needs further investigations what are the workarounds (eg compiling .exe and running directly that instead of |
I added the exclude process support to the startup hook specifically for this scenario, and adding |
Skip from |
After merging #2157 it is better, but I still managed to repro an issue using Test envTesting 908504a on Windows with $ dotnet --version
7.0.102 Repro# it is important to make sure to have a clean repository before testing
git clean -fxd
nuke
# instrument current session
export OTEL_DOTNET_AUTO_HOME=bin/tracer-home
. ./instrument.sh
# run unit tests
cd test/OpenTelemetry.AutoInstrumentation.Tests
dotnet test Errors listed in the output (the test were not run):
It looks like #2036 (comment) I also want to note that cd - # return to root
cd test/test-applications/integrations/TestApplication.Smoke
dotnet run -f net7.0 This is the error I get:
|
I also got an error trying with the steps that you described @pellared on Windows using git-bash to run the scripts:
but notice that the error messages are the ones that you got for the second command (I didn't try that one yet):
|
Same error as @pellared when trying to run the smoke test app. |
I could recreate the issue on
Issue gets resolved, if I manually reset the environment variables to below values.
Collected dotnet trace to check why we ran into an issue. In the non-working case shared store environment variable was not honored. I don't know the reason for it. Resetting only shared store environment variable did not solve an issue. I had to reset all the environment variables like above to get it working. Non-Working
Working
Below were the environmental variable set, just by running
Further analysis is needed to understand what is an issue with |
Related issue #2167 . It looks like the problem is not only with |
For me these error messages were not deterministic. But I remember I had it for |
@pellared @rajkumar-rangaraj here is a case where now it is a bit clear what is happening. In this case, I'm setting only If I run a PS C:\src> Get-WmiObject Win32_Process -Filter "name = 'dotnet.exe'" | Select CommandLine | fl
...
Line : @{CommandLine="C:\Program Files\dotnet\dotnet.exe" exec "C:\Program Files\dotnet\sdk\7.0.101\Roslyn\bincore\VBCSCompiler.dll"
"-pipename:qG18S59RleExn1Gpc05nb8cU695tnOu2clqkRpjneyY"} Then
This error happens before there is any attempt to even load the StartupHook when I'm not sure about the criteria when a VBCSCompiler server is created, but, if there is one running for the project that you are targeting I can run |
We may have to consider not using the AdditionalDeps and loading the dependencies via the StartupHook, see here. That said I'm not sure how that would affect assemblies in the TPA list. Anyway, something that we may have to try. |
Using the corehost tracing, it gives some hope that perhaps the error is actually in our AdditionalDeps. In our shared store the missing assembly is located at:
However, it is being probed at
Notice the different folders just before the assembly: the store is |
I suppose the probe path is due to the respective {
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "7.0.1"
},
"rollForwardOnNoCandidateFx": 2,
"configProperties": {
"System.GC.Server": true,
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
}
}
} |
[EDIT @pjanotti: the issue is fixed for versions after [v0.6.0-beta.1(]https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/tag/v0.6.0-beta.1)]
Exception:
Test App:
The text was updated successfully, but these errors were encountered: