Class CustomMetricMeter
- Namespace
- Temporalio.Extensions.DiagnosticSource
- Assembly
- Temporalio.Extensions.DiagnosticSource.dll
Implementation of ICustomMetricMeter for a Meter that can be set on CustomMetricMeter to record metrics to the meter.
public class CustomMetricMeter : ICustomMetricMeter
- Inheritance
-
CustomMetricMeter
- Implements
- Inherited Members
Remarks
By default all histograms are set as a long
of milliseconds unless
CustomMetricMeterOptions is set to FloatSeconds
.
Similarly, if the unit for a histogram is "duration", it is changed to "ms" unless that same
setting is set, at which point the unit is changed to "s".
Constructors
CustomMetricMeter(Meter)
Initializes a new instance of the CustomMetricMeter class.
public CustomMetricMeter(Meter meter)
Parameters
meter
MeterMeter to back this custom meter implementation with.
Properties
Meter
Gets the underlying meter for this custom meter.
public Meter Meter { get; }
Property Value
Methods
CreateCounter<T>(string, string?, string?)
Create a metric counter.
public ICustomMetricCounter<T> CreateCounter<T>(string name, string? unit, string? description) where T : struct
Parameters
name
stringName for the metric.
unit
stringUnit for the metric if any.
description
stringDescription for the metric if any.
Returns
- ICustomMetricCounter<T>
Counter to be called with updates.
Type Parameters
T
The type of counter value. Currently this is always
long
, but the types can change in the future.
CreateGauge<T>(string, string?, string?)
Create a metric gauge.
public ICustomMetricGauge<T> CreateGauge<T>(string name, string? unit, string? description) where T : struct
Parameters
name
stringName for the metric.
unit
stringUnit for the metric if any.
description
stringDescription for the metric if any.
Returns
- ICustomMetricGauge<T>
Gauge to be called with updates.
Type Parameters
T
The type of gauge value. Currently this can be
long
ordouble
, but the types can change in the future.
CreateHistogram<T>(string, string?, string?)
Create a metric histogram.
public ICustomMetricHistogram<T> CreateHistogram<T>(string name, string? unit, string? description) where T : struct
Parameters
name
stringName for the metric.
unit
stringUnit for the metric if any.
description
stringDescription for the metric if any.
Returns
- ICustomMetricHistogram<T>
Histogram to be called with updates.
Type Parameters
T
The type of histogram value. Currently this can be
long
,double
, or TimeSpan, but the types can change in the future.
Remarks
By default all histograms are set as a long
of milliseconds unless
CustomMetricMeterOptions is set to FloatSeconds
.
Similarly, if the unit for a histogram is "duration", it is changed to "ms" unless that
same setting is set, at which point the unit is changed to "s".
CreateTags(object?, IReadOnlyCollection<KeyValuePair<string, object>>)
Create a new tag set. This created value will be passed to different metric update calls at update time.
public object CreateTags(object? appendFrom, IReadOnlyCollection<KeyValuePair<string, object>> tags)
Parameters
appendFrom
objectIf present, the new tag set should start with these values. Do not mutate this value.
tags
IReadOnlyCollection<KeyValuePair<string, object>>Set of tags. The values of each pair are either
string
,long
,double
, orbool
.
Returns
- object
New tag set to use for metric updates.