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

Instrument<T>

public abstract class Instrument<T> : Instrument where T : struct
The base class for all non-observable instruments.
protected Instrument(Meter meter, string name, string unit, string description)

Create the metrics instrument using the properties meter, name, description, and unit. All classes extending Instrument{T} need to call this constructor when constructing object of the extended class.

protected void RecordMeasurement(T measurement)

Record the measurement by notifying all MeterListener objects which listening to this instrument.

protected void RecordMeasurement(T measurement, ReadOnlySpan<KeyValuePair<string, object>> tags)

Record the measurement by notifying all MeterListener objects which listening to this instrument.

protected void RecordMeasurement(T measurement, KeyValuePair<string, object> tag)

Record the measurement by notifying all MeterListener objects which listening to this instrument.

protected void RecordMeasurement(T measurement, KeyValuePair<string, object> tag1, KeyValuePair<string, object> tag2)

Record the measurement by notifying all MeterListener objects which listening to this instrument.

protected void RecordMeasurement(T measurement, KeyValuePair<string, object> tag1, KeyValuePair<string, object> tag2, KeyValuePair<string, object> tag3)

Record the measurement by notifying all MeterListener objects which listening to this instrument.

protected void RecordMeasurement(T measurement, ref TagList tagList)

Records a measurement by notifying all MeterListener objects that are listening to this instrument.