observatory

Types

pub type Collector {
  ACounter(Counter)
}

Constructors

  • ACounter(Counter)

A CollectorRegistry contains a map of all metric names to their respective Collectors

pub type CollectorRegistry =
  Dict(String, Collector)
pub type Counter =
  Float

Observatory is a Gleam client library for Prometheus

pub type Observatory {
  Observatory(registry: CollectorRegistry)
}

Constructors

  • Observatory(registry: CollectorRegistry)

Functions

pub fn collect(
  observatory: Observatory,
) -> List(#(String, Float))

Return a list of metric names and samples from all Collectors in the CollectorRegistry

pub fn counter_inc(
  observatory: Observatory,
  name: String,
) -> Observatory

Increment a counter by 1.0.

pub fn counter_inc_by(
  observatory: Observatory,
  name: String,
  increment: Float,
) -> Observatory

Increment a counter by a specified Float.

pub fn counter_init(
  observatory: Observatory,
  name: String,
) -> Observatory

Initialize a counter to 0.0.

pub fn init() -> Observatory

Initialize Observatory with an empty Collector Registry

Search Document