-
Notifications
You must be signed in to change notification settings - Fork 302
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.Runtime] Prefer the built-in runtime metrics for .NET 9 targets. #2339
Conversation
FYI @Kielek |
src/OpenTelemetry.Instrumentation.Runtime/MeterProviderBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
- cover both method with new behaviour - update docs - update changelog entry
I do not think that it is worth to do this. For AutoInstrumentation we need to have this behavior in the runtime, so the compilation optimization is not necessary. We can provide it for specific request.
I do not think that we need it. PR is clear. We should relay on what is prepared by the .NET team.
I have added some direct fixes to your branch. Opening the PR for review. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2339 +/- ##
============================================
+ Coverage 73.91% 100.00% +26.08%
============================================
Files 267 2 -265
Lines 9615 145 -9470
============================================
- Hits 7107 145 -6962
+ Misses 2508 0 -2508
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: xiang17 <[email protected]>
Fixes #2071
Changes
Per #2071, this updates the instrumentation to prefer the built-in runtime metrics for .NET 9 targets.
Notes
I was unsure about adding the
net9.0
target explicitly. Is there any prior art for dealing with features only available in specific targets that would be preferred?Should we consider a flag (EnvVar) to disable the built-in metrics and instead prefer the original metrics? Currently, this would be a breaking change for consumers upgrading to .NET 9.0 as metric and attribute names differ. A further consideration is whether this should be opt-in rather than opt-out for those consumers.
In the current implementation, I've excluded much of the API surface in .NET 9.0 and, therefore, had to create public/unshipped API files per target framework. Is there a cleaner way to have all but net9.0 share the same files?
I've opened this PR as a draft while we clarify the approach for the above.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes