-
Notifications
You must be signed in to change notification settings - Fork 857
[AOT] Resolve ConfigurationExtensions and EventSource warnings #4534
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
Conversation
- ConfigurationBinder.GetValue uses Reflection to bind IConfiguration values to strongly typed objects. ConfigurationExtensions.TryGetStringValue was using ConfigurationBinder to get a string value from IConfiguration, which is causing a warning. However, IConfiguration values are already strings, so this is unnecessary. It is also not performant because calling ConfigurationBinder allocates objects and uses TypeDescriptor. - Additionally, suppress 2 EventSource warnings while I'm making changes. Contributes to open-telemetry#3429
src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj
Show resolved
Hide resolved
|
Fixing these configuration warnings would result in publish AotTestApp to be successful? From CI: |
Isn't this the problem you are addressing with https://github.com/open-telemetry/opentelemetry-dotnet/pull/4460/files#diff-982b4ef6e39d21d7e5eac21b9a818d363c9bfe68b62af7e2ccd922ea0697a9baR84? I don't see how resolving these warnings would make the publish to start timing out now. |
...nTelemetry.Instrumentation.AspNetCore/Implementation/AspNetCoreInstrumentationEventSource.cs
Show resolved
Hide resolved
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4534 +/- ##
==========================================
- Coverage 85.61% 85.58% -0.04%
==========================================
Files 320 320
Lines 12610 12610
==========================================
- Hits 10796 10792 -4
- Misses 1814 1818 +4
|
ConfigurationBinder.GetValue uses Reflection to bind IConfiguration values to strongly typed objects. ConfigurationExtensions.TryGetStringValue was using ConfigurationBinder to get a string value from IConfiguration, which is causing a warning. However, IConfiguration values are already strings, so this is unnecessary. It is also not performant because calling ConfigurationBinder allocates objects and uses TypeDescriptor.
Additionally, suppress 2 EventSource warnings while I'm making changes.
Contributes to #3429
cc @Yun-Ting @vitek-karas