Skip to main content

Interface: BufferedMetricUpdate

worker.BufferedMetricUpdate

A single update event on a metric, recorded by buffered metrics exporter.

When the Runtime is configured to buffer metrics, user code must regularly call MetricsBuffer.retrieveUpdates to retrieve the buffered metric updates. Each update event will be represented as a single instance of this interface.

Buffered metrics is an experimental feature. APIs may be subject to change.

Properties

attributes

attributes: MetricTags

Attributes for this update event.

For performance reasons, the SDK tries to re-use the same object across updates for the same attribute set. User code may take advantage of this, e.g. by attaching downstream attribute sets references as a supplementary, non-enumerable property on the MetricTags object. Make sure however not to add, modify or delete any enumerable properties on the MetricTags object, as those changes would affect future update events using the same MetricTags object, as well as further events that extend that MetricTags object.

Note that the SDK may miss deduplication opportunities, notably when a same set of attributes is recreated by the code emitting the metric updates.


metric

metric: Metric

The metric being updated.

For performance reasons, the SDK tries to re-use the same object across updates for the same metric. User code may take advantage of this, e.g. by attaching downstream metric references to as a supplementary property on the Metric object. Note that the SDK may sometimes miss deduplication opportunities, notably when a same metric is accessed from different execution contexts (e.g. from both activity code and workflow code).


value

value: number

Value for this update event.

For counters this is a delta; for gauges and histograms this is the value itself.