Skip to navigation

Experimental. For evaluation. Interfaces, configuration, and behavior may change incompatibly.

Records workflow metrics through the shared telemetry pipeline.

Prerequisites

  • None.

Setup

  • Loads automatically; no configuration needed.

This module provides utilities for recording workflow metrics.

Members

define_float_histogram

metrics.define_float_histogram(name, description, boundaries)

Defines a new float histogram metric.

Parameters
namestringThe name of the metric.
descriptionstringThe description of the metric.
boundarieslist[float]The boundaries of the histogram.

define_int_counter

metrics.define_int_counter(name, description)

Defines a new integer counter metric.

Parameters
namestringThe name of the metric.
descriptionstringThe description of the metric.

define_int_gauge

metrics.define_int_gauge(name, description)

Defines a new integer gauge metric.

Parameters
namestringThe name of the metric.
descriptionstringThe description of the metric.

increment_int_counter

metrics.increment_int_counter(name, value, attrs?)

Increments an integer counter metric.

Parameters
namestringThe name of the metric.
valueintThe value to increment the metric by.
attrs?optionaldict[string:string]A dict of attribute key-value pairs.
Returns
countintThe count value of the metric.

record_float_histogram

metrics.record_float_histogram(name, value, attrs?)

Records a value in a float histogram metric.

Parameters
namestringThe name of the metric.
valuefloatThe value to record.
attrs?optionaldict[string:string]A dict of attribute key-value pairs.
Returns
valuefloatThe recorded value.

set_int_gauge

metrics.set_int_gauge(name, value, attrs?)

Sets the value of an integer gauge metric.

Parameters
namestringThe name of the metric.
valueintThe value to set.
attrs?optionaldict[string:string]A dict of attribute key-value pairs.
Returns
countintThe value of the metric.