ServiceDefaults in templates should not include OpenTelemetry.Instrumentation.Runtime for .NET9+
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
The project templates include a reference to OpenTelemetry.Instrumentation.Runtime (see https://github.com/search?q=repo%3Adotnet%2Faspire+OpenTelemetry.Instrumentation.Runtime+path%3A%2F%5Esrc%5C%2FAspire%5C.ProjectTemplates%5C%2Ftemplates%5C%2F%2F&type=code)
In .NET9+, this package does nothing but enable the built-in `System.Runtime` meter (see https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2339/files).
From my understanding, the plan is to retire the OpenTelemetry.Instrumentation.Runtime package once all pre-.NET9 runtimes are retired. As such, we should remove the package reference for .NET9+ in the template and instead call `.AddMeter("System.Runtime")` directly.
Contributor guide
Assessment
This issue has not been assessed yet.