Observatory

Package Version Hex Docs

A Gleam client library for Prometheus with a focus on simplicity. Currently heavily WIP.

gleam add observatory
import observatory

const http_status_200_metric = "http_total_status_200"
const search_total_items_returned_metric = "search_total_items_returned"

pub fn main() {
   let observatory = observatory.init()
   |> observatory.counter_init(http_status_200_metric)
   |> observatory.counter_init(search_total_items_returned_metric)
   
   // Some code here...
   
   observatory.counter_inc(http_status_200_metric)
   observatory.counter_inc_by(
     search_total_items_returned_metric, 
     returned_items_count
   )
}

Further documentation can be found at https://hexdocs.pm/observatory.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell
Search Document