<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="7.0.0-preview.1.22076.8" />

Meter

public class Meter : IDisposable
Meter is the class responsible for creating and tracking the Instruments.
public string Name { get; }

Gets the Meter name.

public string Version { get; }

Gets the Meter version.

public Meter(string name)

Initializes a new instance of the Meter using the meter name.

public Meter(string name, string version)

Initializes a new instance of the Meter using the meter name and version.

public Counter<T> CreateCounter<T>(string name, string unit = null, string description = null) where T : struct

Create a metrics Counter object.

public Histogram<T> CreateHistogram<T>(string name, string unit = null, string description = null) where T : struct

Creates a Histogram, which is an instrument that can be used to report arbitrary values that are likely to be statistically meaningful. It is intended for statistics such as histograms, summaries, and percentile.

public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<T> observeValue, string unit = null, string description = null) where T : struct

Creates an ObservableCounter, which is an instrument that reports monotonically increasing values when the instrument is being observed.

public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<Measurement<T>> observeValue, string unit = null, string description = null) where T : struct

Creates an ObservableCounter, which is an instrument that reports monotonically increasing values when the instrument is being observed.

public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string unit = null, string description = null) where T : struct

Creates an ObservableCounter, which is an instrument that reports monotonically increasing values when the instrument is being observed.

public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string unit = null, string description = null) where T : struct

Creates an ObservableGauge, which is an asynchronous instrument that reports non-additive values when the instrument is being observed. An example of a non-additive value is the room temperature - it makes no sense to report the temperature value from multiple rooms and sum them up.

public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<Measurement<T>> observeValue, string unit = null, string description = null) where T : struct

Creates an ObservableGauge, which is an asynchronous instrument that reports non-additive values when the instrument is being observed. An example of a non-additive value is the room temperature - it makes no sense to report the temperature value from multiple rooms and sum them up.

public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string unit = null, string description = null) where T : struct

Creates an ObservableGauge, which is an asynchronous instrument that reports non-additive values when the instrument is being observed. An example of a non-additive value is the room temperature - it makes no sense to report the temperature value from multiple rooms and sum them up.

public void Dispose()

Dispose the Meter which will disable all instruments created by this meter.