-
Notifications
You must be signed in to change notification settings - Fork 751
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
Retire IResourceMonitor set of API in favor of observable instruments #5414
Comments
@RussKie @joperezr @geeknoid @andrey-noskov - please take a look when you have time |
Regarding your "con", given that we wouldn't be deleting the API and just marking it obsolete, then nobody would be 'blocked', right? |
yes, please! |
Yes. Another question - I assume we will be able to delete any Obsolete API when .NET 8 support ends, e.g. in 2026? |
@joperezr Are obsoleted APIs ever removed from the code base? |
Yes, they can be. Typically that is done in the subsequent LTS version after being marked as obsoleted (in an LTS version too). This policy is documented here: https://learn.microsoft.com/en-us/dotnet/core/compatibility/api-removal |
@evgenyfedorov2: sounds good to me. We can mark these API (and anything else related) as obsolete in the .NET 9 release (i.e., the dev branch). We'll also need to create migration guides. There isn't much time before we switch to .NET 9, so we should do this before then. |
Currently, ResourceMonitoring can be consumed in two ways:
BackgroundService
Both ways provide the same resource monitoring data, so essentially we have duplicated functionality. We can simplify it all by deprecating the
IResourceMonitor
API and recommend the observable instruments as the only way forward. Namely, we can deprecate following classes (or structs):src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/SystemResources.cs
src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/Snapshot.cs
src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/ResourceUtilization.cs
src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/ISnapshotProvider.cs
src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/IResourceMonitorBuilder.cs
src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/IResourceMonitor.cs
Pros:
BackgroundService
Cons:
IResourceMonitor
will be blocked in case they don't use .NET MetricsThe text was updated successfully, but these errors were encountered: