Developer Tooling · zero-dependency · MIT

larzmetrics

Metrics + Prometheus export.

Counters, gauges and histograms with a Prometheus text exposition export — application metrics without a client library.

larzscript pkg install metrics
View on GitHub →Learn the stack

What you get

Try it

import "metrics" as metrics
let m = metrics.new()
metrics.counter_inc(m, "requests_total", {"method": "GET"})
metrics.counter_inc(m, "requests_total", {"method": "GET"})
metrics.gauge_set(m, "queue_depth", 5)
metrics.histogram_observe(m, "latency_seconds", 0.23, {}, [0.1, 0.5, 1])
print(metrics.export_prometheus(m))
Output
requests_total{method="GET"} 2
queue_depth 5
latency_seconds_bucket{le="0.1"} 0
latency_seconds_bucket{le="0.5"} 1
latency_seconds_bucket{le="1"} 1
latency_seconds_sum 0.23
latency_seconds_count 1

Why it's in the Larz Stack

larzmetrics is a real Larzscript package (larzscript pkg install metrics) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.