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

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.

protected void RecordMeasurement(T measurement)

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

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

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

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

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

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

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

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

Records a measurement by notifying all MeterListener objects that are 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.