v0.2.0
[0.2.0] - 2026-06-12: capture meters created by an IMeterFactory
Minor release. Adds scope-aware capture so a meter created by an IMeterFactory (the standard ASP.NET Core DI metrics path) can be captured by name. Purely additive.
Added
InstrumentCapture.OfName<T>(object? meterScope, string meterName, string instrumentName, TimeProvider?)andMeterCapture.For(string meterName, object? meterScope)capture an instrument on a meter whoseMeter.ScopeequalsmeterScope. A meter created by anIMeterFactorycarries the factory as its scope, so pass that factory to capture it; the existing no-scope overloads match only a meter created directly (new Meter(name)) and silently capture nothing from a factory-created one. The no-scope overloads now delegate to the scope-aware ones with a null scope, so existing behavior is unchanged. The by-referenceMeterCapture.Add(Instrument<T>)now also requires the instrument's meter scope to match the bundle's scope (it already required the meter name to match), so an instrument from a same-named but differently-scoped meter is rejected.
Changed
- Bumped
PackageValidationBaselineVersionfrom0.0.1to0.1.0on both packages so ApiCompat strict-mode validates0.2.0against the most recently published baseline. The new overloads are recorded as additive differences inCompatibilitySuppressions.xml.