Skip to content

LabelValue

LabelValue = string | number | boolean

Defined in: src/metrics/Metrics.ts:28

In-process metrics primitives for the actor framework (#11).

Three classic types:

  • Counter — monotonic, only goes up. Page views, messages delivered, restart counts.
  • Gauge — settable / inc/dec. Mailbox depth, members up, active connections.
  • Histogram — fixed buckets + sum + count. Persist latency, handler duration. Bucket boundaries are upper-inclusive (le="0.005" matches the Prometheus convention).

Metrics carry labels — key/value tag pairs that turn one metric into many time series. A MetricsRegistry.counter('foo') with no labels has one series; with {node: 'n-1'} you get one series per distinct value of node.

Cardinality discipline is the user’s responsibility — high-cardinality labels (request id, user id, …) will OOM your monitoring system. The registry doesn’t enforce limits; it’ll happily create one series per combo you ask for.

Exposition format is decoupled — see PrometheusExporter for the Prometheus 0.0.4 text format implementation.