Skip to main content
PromGleam is a Prometheus client library for Gleam, built on top of the battle-tested prometheus.erl. It provides a type-safe, idiomatic Gleam interface for instrumenting your applications with Prometheus metrics.

Why PromGleam?

PromGleam brings Prometheus monitoring to the Gleam ecosystem with:
  • Type-safe metrics - Leverage Gleam’s type system to catch errors at compile time
  • Simple API - Clean, intuitive functions for creating and updating metrics
  • Full metric support - Counters, gauges, and histograms with all their features
  • Production ready - Built on prometheus.erl, used in production Erlang systems
  • Easy integration - Works seamlessly with Gleam web frameworks like Wisp

Quick example

Here’s how simple it is to track HTTP requests with PromGleam:
import promgleam/metrics/counter.{create_counter, increment_counter}

// Create a counter metric
create_counter(
  registry: "default",
  name: "http_requests_total",
  help: "Total number of HTTP requests",
  labels: ["method", "route", "status"],
)

// Increment it when handling requests
increment_counter(
  registry: "default",
  name: "http_requests_total",
  labels: ["GET", "/", "200"],
  value: 1,
)

Get started

Installation

Install PromGleam in your project with a single command

Quickstart

Create your first counter metric in under 5 minutes

Metric types

Learn about counters, gauges, and histograms

Examples

Explore real-world integration examples

Supported metric types

PromGleam supports all Prometheus metric types:
  • Counters - Monotonically increasing values for tracking totals (requests, errors, tasks)
  • Gauges - Values that can go up or down (temperature, memory usage, active connections)
  • Histograms - Distribution of observations with configurable buckets (request duration, response sizes)

What’s next?

Ready to add metrics to your Gleam application? Start with the installation guide or jump straight into the quickstart tutorial.

Build docs developers (and LLMs) love