extensions icon indicating copy to clipboard operation
extensions copied to clipboard

AddResourceMonitoring with options is marked as obsolete

Open leoquijano opened this issue 4 months ago • 1 comments

Description

We're using the .NET resource monitoring API to obtain metrics for CPU and Memory usage. There's one option that is mandatory for us to use, to work around a bug that wasn't directly fixed in code (the issue reported in #5472).

The problem that we have now is that when we try to use AddResourceMonitoring overload that accepts options, it comes up as obsolete. Is this intentional? My understanding is that the IResourceMonitor API was marked as obsolete (#5773), but that the .NET resource monitoring library is the right one to use now.

Is that case? If so, which method should I use to configure options for this functionality?

Reproduction Steps

Try to call AddResourceMonitoring(IServiceCollection, Action<IResourceMonitorBuilder>) in code.

Expected behavior

We should be able to use this method without any compiler warnings or errors.

Actual behavior

The compiler throws an error due to the method being obsolete, and no alternatives are given.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

leoquijano avatar Sep 11 '25 03:09 leoquijano

Hi team, could we please prioritize this issue?

Ours team also need a way to configure ResourceMonitoringOptions: (1) enable the required flags to ensure data accuracy (as in issue #5472), and (2) override CpuConsumptionRefreshInterval and MemoryConsumptionRefreshInterval to to larger values (e.g., 15s). With the current 5s default, it is spending unnecessary CPU cycles on sampling; 15s would significantly reduce overhead without hurting observability.

Do we have any alternative solution or plan for this at the moment?

duanyanan avatar Oct 22 '25 07:10 duanyanan