themis

Types

pub type ThemisError {
  GaugeError(gauge.GaugeError)
  HistogramError(histogram.HistogramError)
  CounterError(counter.CounterError)
}

Constructors

  • GaugeError(gauge.GaugeError)
  • HistogramError(histogram.HistogramError)
  • CounterError(counter.CounterError)

Functions

pub fn init() -> Store

Initializes a new empty metrics store.

pub fn print(store store: Store) -> Result(String, ThemisError)

Formats all metrics in the store as a Prometheus-compatible text string.

Examples

let metrics_text = print(store)
// # HELP my_metric My first gauge
// # TYPE my_metric gauge
// my_metric{foo="bar"} 10
// my_metric{toto="tata",wibble="wobble"} +Inf
Search Document