-
Notifications
You must be signed in to change notification settings - Fork 765
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
.NET 7 - OpenTelemetry.SuppressInstrumentationScope cannot be initialized with PublishTrimmed=true #4600
Comments
Do you get any trim warnings when publishing the app? #3429 tracks the work to make OpenTelemetry AOT compatible which will also make it trim compatible. |
@vitek-karas, thanks for explanations. IMO, the strange behavior is that the same operation is working fine for .NET 6, but not for .NET 7. List of warnings.
Please close if you think that it will be handled by #3429. |
The tooling only makes one promise: If there are no warnings, the app should work the same when trimmed as well. |
Thanks for explanation. Closing. |
* [cartservice] Update to .NET 7 * Add changelog entry * Avoid trimming application due open-telemetry/opentelemetry-dotnet#4600
* [cartservice] Update to .NET 7 * Add changelog entry * Avoid trimming application due open-telemetry/opentelemetry-dotnet#4600
* [cartservice] Update to .NET 7 * Add changelog entry * Avoid trimming application due open-telemetry/opentelemetry-dotnet#4600
Bug Report
List of all OpenTelemetry NuGet
packages and version that you are
using (e.g.
OpenTelemetry 1.0.2
):Runtime version (e.g.
net462
,net48
,netcoreapp3.1
,net6.0
etc. You canfind this information from the
*.csproj
file):.NET 7 (works fine for .NET 6) - tested with Windows and Alpine runtime
Symptom
OpenTelemetry cannot be initialized when published with
PublishTrimmed=True and -p:TrimMode=Link
What is the expected behavior?
No Exception. OTel is working.
What is the actual behavior?
Exception while initializing OTel
Reproduce
Reproducible using opentelemetry-demo:
docker compose build cartservice
anddocker compose up
.or
go to
src\cartservice
and execute
dotnet restore ./src/cartservice.csproj -r win-x64 dotnet publish ./src/cartservice.csproj -p:PublishSingleFile=true -r win-x64 --self-contained true -p:PublishTrimmed=True -p:TrimMode=Link -c Release -o /cartservice --no-restore
Then execute created application
Additional Context
It is working fine for .NET 6.
Temporary workaround for otel-demo open-telemetry/opentelemetry-demo@d24e7ce
The text was updated successfully, but these errors were encountered: