Conditionally remove instrument caching in Metrics source-gen
Open
area-telemetry
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 894
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
Right now we have caching of instruments in Metrics source-gen:
https://github.com/dotnet/extensions/blob/7271d1923ef31670feefbcba1e55751dcc3e6bfa/src/Generators/Microsoft.Gen.Metrics/MetricFactoryEmitter.cs#L109
The original issue https://github.com/dotnet/runtime/issues/84713 was resolved in `System.Diagnostics.DiagnosticSource` of version 8, thus we can check its version during generation time and omit adding any caching logic. If the package version is older than 8, we will produce the same codebase as we have now.
Contributor guide
Assessment
This issue has not been assessed yet.