Gauge

Inheritance diagram of Gauge

Gauge inheritance diagram

class savant.metrics.Gauge(name, description='', labelnames=())

Gauge metric.

Usage example:

gauge = Gauge(
    name='total_queue_length',
    description='The total queue length for the pipeline',
)
gauge.set(123)
set(value, labels=(), timestamp=None)

Set gauge to specific value.

Parameters:
  • value – Gauge value.

  • labels (Tuple[str, ...]) – Labels values.

  • timestamp (float | None) – Metric timestamp.

property description: str

Metric description.

property labelnames: Tuple[str, ...]

Metric label names.

property name: str

Metric name.

property values: Dict[Tuple[str, ...], Tuple[float, float]]

Metric values.

Returns:

Dictionary: labels -> (value, timestamp).