Meter.CreateObservableGauge Method

Definition

Overloads

CreateObservableGauge<T>(String, Func<Measurement<T>>, String, String, IEnumerable<KeyValuePair<String,Object>>)

ObservableGauge is an asynchronous Instrument which reports non-additive value(s) (e.g. the room temperature - it makes no sense to report the temperature value from multiple rooms and sum them up) when the instrument is being observed.

CreateObservableGauge<T>(String, Func<T>, String, String, IEnumerable<KeyValuePair<String,Object>>)

ObservableGauge is an asynchronous Instrument which reports non-additive value(s) (e.g. the room temperature - it makes no sense to report the temperature value from multiple rooms and sum them up) when the instrument is being observed.

CreateObservableGauge<T>(String, Func<IEnumerable<Measurement<T>>>, String, String, IEnumerable<KeyValuePair<String,Object>>)

Creates an ObservableGauge instance, which is an asynchronous Instrument that reports non-additive value(s) when the instrument is being observed.

CreateObservableGauge<T>(String, Func<IEnumerable<Measurement<T>>>, String, String)

Creates an ObservableGauge, which is an asynchronous instrument that reports non-additive values when the instrument is being observed.

CreateObservableGauge<T>(String, Func<Measurement<T>>, String, String)

Creates an ObservableGauge, which is an asynchronous instrument that reports non-additive values when the instrument is being observed.

CreateObservableGauge<T>(String, Func<T>, String, String)

Creates an ObservableGauge, which is an asynchronous instrument that reports non-additive values when the instrument is being observed.

CreateObservableGauge<T>(String, Func<Measurement<T>>, String, String, IEnumerable<KeyValuePair<String,Object>>)

Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs

ObservableGauge is an asynchronous Instrument which reports non-additive value(s) (e.g. the room temperature - it makes no sense to report the temperature value from multiple rooms and sum them up) when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableGauge<T> CreateObservableGauge<T>(string name, Func<System.Diagnostics.Metrics.Measurement<T>> observeValue, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
C#
public System.Diagnostics.Metrics.ObservableGauge<T> CreateObservableGauge<T>(string name, Func<System.Diagnostics.Metrics.Measurement<T>> observeValue, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>>? tags) where T : struct;

Type Parameters

T

The numerical type of the measurement.

Parameters

name
String

The instrument name. cannot be null.

observeValue
Func<Measurement<T>>

The callback to call to get the measurements when the Observe() is called by RecordObservableInstruments().

unit
String

Optional instrument unit of measurements.

description
String

Optional instrument description.

tags
IEnumerable<KeyValuePair<String,Object>>

tags to attach to the counter.

Returns

A new observable gauge.

Applies to

.NET 10 and other versions
Product Versions
.NET 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

CreateObservableGauge<T>(String, Func<T>, String, String, IEnumerable<KeyValuePair<String,Object>>)

Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs

ObservableGauge is an asynchronous Instrument which reports non-additive value(s) (e.g. the room temperature - it makes no sense to report the temperature value from multiple rooms and sum them up) when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
C#
public System.Diagnostics.Metrics.ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>>? tags) where T : struct;

Type Parameters

T

The numerical type of the measurement.

Parameters

name
String

The instrument name. cannot be null.

observeValue
Func<T>

The callback to call to get the measurements when the Observe() is called by RecordObservableInstruments().

unit
String

Optional instrument unit of measurements.

description
String

Optional instrument description.

tags
IEnumerable<KeyValuePair<String,Object>>

tags to attach to the counter.

Returns

A new observable gauge.

Applies to

.NET 10 and other versions
Product Versions
.NET 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

CreateObservableGauge<T>(String, Func<IEnumerable<Measurement<T>>>, String, String, IEnumerable<KeyValuePair<String,Object>>)

Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs

Creates an ObservableGauge instance, which is an asynchronous Instrument that reports non-additive value(s) when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableGauge<T> CreateObservableGauge<T>(string name, Func<System.Collections.Generic.IEnumerable<System.Diagnostics.Metrics.Measurement<T>>> observeValues, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
C#
public System.Diagnostics.Metrics.ObservableGauge<T> CreateObservableGauge<T>(string name, Func<System.Collections.Generic.IEnumerable<System.Diagnostics.Metrics.Measurement<T>>> observeValues, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>>? tags) where T : struct;

Type Parameters

T

The numerical type of the measurement.

Parameters

name
String

The instrument name. It cannot be null.

observeValues
Func<IEnumerable<Measurement<T>>>

The callback to call to get the measurements when the Observe() is called by RecordObservableInstruments().

unit
String

An optional instrument unit of measurements.

description
String

An optional instrument description.

tags
IEnumerable<KeyValuePair<String,Object>>

The tags to attach to the counter.

Returns

A new observable gauge.

Remarks

For example: The room temperature - it makes no sense to report the temperature value from multiple rooms and sum them up.

Applies to

.NET 10 and other versions
Product Versions
.NET 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

CreateObservableGauge<T>(String, Func<IEnumerable<Measurement<T>>>, String, String)

Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs

Creates an ObservableGauge, which is an asynchronous instrument that reports non-additive values when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableGauge<T> CreateObservableGauge<T>(string name, Func<System.Collections.Generic.IEnumerable<System.Diagnostics.Metrics.Measurement<T>>> observeValues, string? unit = default, string? description = default) where T : struct;

Type Parameters

T

The numerical type of the measurement.

Parameters

name
String

The instrument name. Cannot be null.

observeValues
Func<IEnumerable<Measurement<T>>>

The callback to call to get the measurements when ObservableCounter{T}.Observe() is called by RecordObservableInstruments().

unit
String

Optional instrument unit of measurements.

description
String

Optional instrument description.

Returns

A new observable gauge.

Remarks

An example of a non-additive value is the room temperature; that is, it doesn't make sense to report the temperature value from multiple rooms and sum them up.

Applies to

.NET 10 and other versions
Product Versions
.NET 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

CreateObservableGauge<T>(String, Func<Measurement<T>>, String, String)

Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs

Creates an ObservableGauge, which is an asynchronous instrument that reports non-additive values when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableGauge<T> CreateObservableGauge<T>(string name, Func<System.Diagnostics.Metrics.Measurement<T>> observeValue, string? unit = default, string? description = default) where T : struct;

Type Parameters

T

The numerical type of the measurement.

Parameters

name
String

The instrument name. Cannot be null.

observeValue
Func<Measurement<T>>

The callback to call to get the measurements when ObservableCounter{T}.Observe() is called by RecordObservableInstruments().

unit
String

Optional instrument unit of measurements.

description
String

Optional instrument description.

Returns

A new observable gauge.

Remarks

An example of a non-additive value is the room temperature; that is, it doesn't make sense to report the temperature value from multiple rooms and sum them up.

Applies to

.NET 10 and other versions
Product Versions
.NET 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

CreateObservableGauge<T>(String, Func<T>, String, String)

Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs

Creates an ObservableGauge, which is an asynchronous instrument that reports non-additive values when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string? unit = default, string? description = default) where T : struct;

Type Parameters

T

The numerical type of the measurement.

Parameters

name
String

The instrument name. Cannot be null.

observeValue
Func<T>

The callback to call to get the measurements when ObservableCounter{T}.Observe() is called by RecordObservableInstruments().

unit
String

Optional instrument unit of measurements.

description
String

Optional instrument description.

Returns

A new observable gauge.

Remarks

An example of a non-additive value is the room temperature; that is, it doesn't make sense to report the temperature value from multiple rooms and sum them up.

Applies to

.NET 10 and other versions
Product Versions
.NET 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)