Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 12 Jun 17:34
· 7 commits to main since this release
v0.2.0
a4c8757

[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?) and MeterCapture.For(string meterName, object? meterScope) capture an instrument on a meter whose Meter.Scope equals meterScope. A meter created by an IMeterFactory carries 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-reference MeterCapture.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 PackageValidationBaselineVersion from 0.0.1 to 0.1.0 on both packages so ApiCompat strict-mode validates 0.2.0 against the most recently published baseline. The new overloads are recorded as additive differences in CompatibilitySuppressions.xml.