opentelemetry-dotnet
opentelemetry-dotnet copied to clipboard
[sdk-metrics] Fix a race condition when a metric is deactivated and re-activated in the same collection cycle
Fixes #5907
Changes
- Use
TryUpdateinstead ofTryRemovewhen processing a removed metric so that the lookup dictionary is only modified if a new metric hasn't already been enrolled
Merge requirement checklist
- [X] CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)