AddResourceMonitoring() do no-operation if not supported OS
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 894
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
### Description
I'm currently working on MacOS and it seems like https://source.dot.net/#Microsoft.Extensions.Diagnostics.ResourceMonitoring/ResourceMonitoringServiceCollectionExtensions.cs,7ba4439b710f2460,references throws an exception if the OS is not supported.
I would prefer it did a no-op. We go through all OS' and we need to do:
```
if (!OperatingSystem.IsMacOS())
{
builder.Services.AddResourceMonitoring();
}
```
In the calling code.
### Reproduction Steps
Run `builder.Services.AddResourceMonitoring();`.
### Expected behavior
Just do no-op and return early if not supported OS.
### Actual behavior
Throws exception
### Regression?
_No response_
### Known Workarounds
Add if statement at consuming code
### Configuration
_No response_
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.