<PackageReference Include="Microsoft.Extensions.Diagnostics.Abstractions" Version="10.0.8" />

Microsoft.Extensions.Diagnostics.Metrics.InstrumentRule

public class InstrumentRule
Contains a set of parameters used to determine which instruments are enabled for which listeners. Unspecified parameters match anything.
public bool Enable { get; }

Gets a value that indicates whether the instrument should be enabled for the listener.

public string InstrumentName { get; }

Gets the NameInstrument.Name, an exact match.

public string ListenerName { get; }

Gets the NameIMetricsListener.Name, an exact match.

public string MeterName { get; }

Gets the NameMeter.Name, either an exact match or the longest prefix match. Only full segment matches are considered.

public MeterScope Scopes { get; }

Gets the MeterScope.

public InstrumentRule(string meterName, string instrumentName, string listenerName, MeterScope scopes, bool enable)

Contains a set of parameters used to determine which instruments are enabled for which listeners. Unspecified parameters match anything.