Skip to content

counter_series:observe

series:observe(value)
Since: Version 2026.05.12-a6845223

The functionality described in this section requires version 2026.05.12-a6845223 of KumoMTA, or a more recent version.

Sets the current bucket of the series to value, replacing any prior value recorded for the current time window.

  • value — unsigned integer to record. Must be >= 0.

observe is intended for tracking gauge-like measurements where each call produces a fresh reading (for example, the size of a queue sampled periodically), as opposed to increment which accumulates.

Older buckets are not affected; they continue to age out as time elapses.

Example

local series = kumo.counter_series.define {
  name = 'queue.depth',
  num_buckets = 6,
  bucket_size = '10s',
}
series:observe(current_queue_depth())