Skip to content
CAI
Software that uses CAICheck a score

prometheus-erl/prometheus.ex

62.7

Adequate · 3 October 2026

1.8k

lines of production code

Elixir

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is an Elixir client library for Prometheus that provides a high-level API for instrumenting applications with metrics. It supports the creation and management of core metric types, including counters, gauges, histograms, summaries, and booleans, while offering helpers for HTTP request tracking and Mnesia database monitoring. The library enables metric serialization in both standard text and Protocol Buffer formats and integrates with the underlying Erlang Prometheus implementation through Elixir-specific abstractions and error handling.

Features

Add Protobuf and Text format exporters

New format modules have been added to serialize the Prometheus registry into Protocol Buffer and standard text formats. Users can now export metrics in these additional formats via the new \Prometheus.Format.Protobuf\ and \Prometheus.Format.Text\ modules, which delegate to the underlying \prometheus\_protobuf\_format\ and \prometheus\_text\_format\ implementations.

lib/prometheus/format · high confidence

Initial project scaffolding and documentation

This change establishes the foundational configuration and documentation for the project. It adds a \.credo.exs\ file to configure the Credo linter (disabling specific readability and alias usage checks), a \.formatter.exs\ file to standardize Elixir code formatting (90-character line length, specific delegate locals), and a \.gitignore\ file to exclude build artifacts, dependencies, and crash dumps. Additionally, it introduces an MIT \LICENSE\, a \coveralls.json\ configuration to skip specific files from coverage reports, and a comprehensive \README.md\ that details the library's purpose as an Elixir Prometheus client, provides usage examples, lists integrations, and outlines installation steps for version 4.0.

(repo-wide) · high confidence

Introduction of Prometheus module with \`\_\_using\_\_\` macro

The library now provides a \Prometheus\ module that serves as the primary entry point for Elixir applications. It includes a \\_\using\\_\ macro which, when invoked via \use Prometheus\, automatically requires and uses essential modules such as \Prometheus.Metric\, \Prometheus.Registry\, \Prometheus.Buckets\, and \Prometheus.Contrib.HTTP\. This simplifies the setup process for custom instrumenters by reducing the boilerplate needed to access common Prometheus functionality.

lib · high confidence

New Boolean metric type and refactored metric implementations

The library now includes a new Boolean metric type (Prometheus.Metric.Boolean) for reporting flags and states, alongside a complete rewrite of the existing Counter, Gauge, Histogram, and Summary modules. These metric implementations now delegate function calls to the underlying Erlang prometheus library instead of using macros, and support Elixir 1.7/OTP 21 stacktrace handling. The Counter module adds \count\_exceptions\ and \count\_no\_exceptions\ macros for exception tracking, while Gauge and Histogram/Summary modules now support \observe\_duration\ and \set\_duration\/\track\_inprogress\ macros for timing blocks of code.

lib/prometheus/metric · high confidence

New HTTP and Mnesia instrumentation helpers

Added new contrib modules for HTTP and Mnesia instrumentation. The HTTP module provides helpers for measuring request duration using standard microsecond buckets and classifying HTTP status codes. The Mnesia module exposes metrics for table disk sizes and transaction counts (participant and coordinator), allowing users to monitor Mnesia database performance and storage usage.

lib/prometheus/contrib · high confidence

Behavioural changes

Prometheus library rewritten with new Elixir abstractions and error handling

The \lib/prometheus\ directory has been completely rewritten to introduce new Elixir-level abstractions for building and managing metrics. A new \Prometheus.Collector\ behavior allows advanced users to implement custom collectors by defining \collect\_mf\ and \collect\_metrics\ callbacks, while \Prometheus.Config\ provides a macro to generate configuration accessors with support for mandatory options. Metric declaration is now handled via \Prometheus.Metric\ using module attributes (e.g., \@counter\) that are processed at compile time via \@before\_compile\, automatically registering metrics if the Prometheus application is started or deferring registration otherwise. The library also introduces a comprehensive set of custom error types in \Prometheus.Error\ (such as \InvalidMetricNameError\ and \InvalidBucketsError\) to replace generic Erlang errors, and utilizes a new \Prometheus.Erlang\ module to delegate calls to the underlying Erlang \prometheus\ library while wrapping them in Elixir error handling.

lib/prometheus · high confidence

Test coverage

Added Mnesia test fixtures; Added test coverage for Boolean, Counter, Gauge, Histogram, and Summary metrics; Added tests for HTTP and Mnesia contrib modules; Added tests for Prometheus text and protobuf format outputs; Initial test suite for Prometheus metrics library.

Dependencies

Initial release of Prometheus.ex v5.1.0

This change introduces the initial version (5.1.0) of the Prometheus.ex Elixir client, establishing the project's dependency on the core \prometheus\ library (v6.1.2) and configuring the build environment for Elixir 1.7+. It also sets up the development toolchain, including Credo for linting, Dialyxir for static analysis, ExDoc for documentation, and ExCoveralls for test coverage reporting.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 56 → 63 (+7.1)
  • Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.

Lenses

  • Code Health 99 → 99 (+0.5)
  • Architecture 97 → 97 (+0.8)
  • Maturity 37 → 49 (+12.3)
  • Readiness 61 → 63 (+2.0)
  • Security 74 → 78 (+4.4)

Resolved (1)

  • Documentation: no installation or build instructions (README.md)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

prometheus-erl/prometheus.ex was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 88080cb56b95c5afc25d9cad223edac1f9b45b27 — the exact code this score is about.
  • Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-8fe32cd45d00.