Interface ICustomMetricMeter
- Namespace
- Temporalio.Runtime
- Assembly
- Temporalio.dll
Interface to implement to support custom metric handling.
public interface ICustomMetricMeter
Methods
CreateCounter<T>(string, string?, string?)
Create a metric counter.
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.
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.
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.
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.