<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />

ObservableInstrument<T>

public abstract class ObservableInstrument<T> : Instrument where T : struct
ObservableInstrument{T} is the base class from which all metrics observable instruments will inherit.
protected ObservableInstrument(Meter meter, string name, string unit, string description)

Initializes a new instance of the ObservableInstrument<T> class using the specified meter, name, description, and unit. All classes that extend ObservableInstrument{T} must call this constructor when constructing objects of the extended class.

protected ObservableInstrument(Meter meter, string name, string unit, string description, IEnumerable<KeyValuePair<string, object>> tags)

protected abstract IEnumerable<Measurement<T>> Observe()

Fetches the current measurements being tracked by this instrument. All classes extending ObservableInstrument{T} need to implement this method.