Reload configuration in RandomProbabilisticSampler only when T is changed
Open
area-telemetry
untriaged
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 894
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
Currently, configuration [is](https://source.dot.net/#Microsoft.Extensions.Telemetry/Sampling/RandomProbabilisticSampler.cs,365c43912fa08496,references) reloaded when any change in `IConfiguration` occurs due to [poor](https://github.com/dotnet/runtime/issues/109445) design of `IOptionsMonitor`. Please optimize the code in RandomProbabilisticSampler so that it reloads configuration only when the actual type `T` changes or logger filter configuration is updated. This is necessary to limit the number of memory allocations for new arrays whenever configurations changes.
Contributor guide
Assessment
This issue has not been assessed yet.