-
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
Workaround dotnet CLI issue #2131
Workaround dotnet CLI issue #2131
Conversation
| Environment variable | Description | Default value | | ||
|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------| | ||
| `OTEL_DOTNET_AUTO_HOME` | Installation location. | | | ||
| `OTEL_DOTNET_AUTO_EXCLUDE_PROCESSES` | Names of the executable files that the profiler cannot instrument. Supports multiple comma-separated values, for example: `ReservedProcess.exe,powershell.exe`. | dotnet,dotnet.exe,powershell.exe,pwsh,pwsh.exe | |
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.
dotnet,dotnet.exe,powershell.exe,pwsh,pwsh.exe
seems like an excellent base, we should make a next step issue, where we can work out more complete list.
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 do not think we should ignore dotnet
. See #2131 (comment)
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 with that sentiment @pellared: ideally, we would instrument dotnet <dll>
, but, not the other usages of dotnet
.
There is problem with tests, because of bytecode instrumentations not being initialized.
I think the way test applications are started is a common one. |
Good point @lachmatt - 🤔 how to better handle that... |
At first, the options coming to my mind are:
I'm leaning towards option 1 for consistency and to avoid dealing with some unknown special cases with |
Converted PR to draft until I try a few things. |
I think it is a huge downside. Even the Microsoft samples use it e.g. https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/README.md#build-a-net-image It would be great to somehow just disable the auto-instrumentation for self-contained executables... |
I was under the impression that we were not using While I want to improve the general For reference, list of Microsoft.Extensions.* DLLs that allow
|
Manipulate the DOTNET_* env vars in the StartupHook according if the process is excluded or not. This allows a better UX with dotnet CLI.
Did some research and understood dotnet.exe respects both AdditionalDeps and Runtime store. The issue we are facing could happen with any other apps which has package reference like dotnet.exe. Looks like |
@rajkumar-rangaraj One of the issues that we are having with the dependencies is that the I tested some self-contained apps and we didn't have a problem with those. Granted these were simple demo apps. Anyway, as you said there seem to be more issues with our additional deps that still need to be understood besides the |
I got it to work, but, I had to downgrade some assemblies to 6.0.0. I still have to polish this change, but, just so I get a vision of other potential problems with CI I'm going to push the changes. Anyway, for making the actual change I will wait for the package upgrade. I do expect some tests that depend on AspNetCore to break since I'm taking a shortcut to deal with the |
6b5b347
to
94c2f75
Compare
Why
To improve the UX with
dotnet
CLI.Helps with #1744
What
Manipulate the DOTNET_* env vars in the StartupHook according if the process is excluded or not. This allows a better UX with dotnet CLI and effective process exclusion in such cases.
The documentation should be updated too, but, only at the time of a new release. Prior to a release with this workaround #2128 should be visible to users.
Tests
Added automated tests for
dotnet
CLI.Checklist
CHANGELOG.md
is updated.