The Microsoft.Extensions.Telemetry.Abstractions source generator for System.Diagnostics.Metrics APIs generates boilerplate code for creating strongly-typed metrics and tag objects. However, the generated code offers minimal advantages over manual implementation—it doesn't improve performance, limits API flexibility (missing
•15m read time• From andrewlock.net
Table of contents
Background: System.Diagnostics.Metrics APIsBackground: sample app with manual boilerplateReplacing boiler plate with a source generatorUsing strongly-typed tag objectsAre the source generators worth using?SummarySort: