Skip to content
CAI
Software that uses CAICheck a score

akoutmos/prom_ex

56.3

Adequate · 3 October 2026

8.4k

lines of production code

Elixir

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

PromEx is an Elixir library that provides a plugin-based architecture for collecting telemetry metrics from various sources, including Phoenix, Ecto, Oban, and Broadway. It features a pluggable storage system, a standalone HTTP metrics server with authentication, and automated integration with Grafana for dashboard publishing and agent configuration. The system also includes comprehensive tooling for generating configurations, exporting dashboards, and stress testing via example applications.

How it got here

2020 — Initial release and plugin architecture

24 changes.

This period covers the initial scaffolding and first stable release of PromEx, establishing a plugin-based architecture for collecting telemetry metrics from libraries like Phoenix, Ecto, and Oban. The work included implementing core features such as configurable storage, a standalone metrics HTTP server, and automated Grafana dashboard publishing via EEx templates. A comprehensive example application was also built to demonstrate integration with background jobs and event processing, supported by extensive test coverage for the new core components and plugins.

2021–2024 — observability integrations and storage extensibility

7 changes.

This period focused on expanding PromEx's observability capabilities by introducing a native Grafana Agent integration for automated binary management and configuration. Developers also implemented pluggable storage adapters to allow users to choose between different metrics backends. The work was supported by comprehensive test coverage for these new features, alongside the addition of benchmarking scripts and telemetry event fixtures.

Features

Add pluggable storage adapters for metrics

PromEx now supports pluggable storage mechanisms for metrics, allowing users to choose between different backends. This change introduces two new storage adapters: \PromEx.Storage.Core\, which utilizes \TelemetryMetricsPrometheus.Core\ as the underlying storage, and \PromEx.Storage.Peep\, which uses the \Peep\ library. Both adapters implement the \PromEx.Storage\ behavior, providing consistent \scrape\ and \child\_spec\ interfaces for managing metrics storage.

_lib/prom\ex/storage · high confidence

Added sample application scaffolding with database migrations and localization templates

The sample web application now includes foundational setup files in the \priv\ directory. This adds Ecto database migrations to create a \users\ table and initialize the Oban jobs table (supporting both default and custom prefixes), along with a seed script to populate the database with sample user data. Additionally, Gettext localization template files (\.pot\ and \.po\) for English error messages are included to support internationalization of validation errors.

_example\_applications/web\app/priv · high confidence

Expanded sample application with background jobs and data contexts

The sample application now includes a full user management context (WebApp.Accounts) with Ecto schemas and repository support, alongside a robust background job infrastructure using Oban with multiple worker queues (default, media, events) and a random work generator to simulate load. It also integrates Broadway for event processing (CityProducer/TempProcessor) and configures PromEx to expose comprehensive metrics for Phoenix, Ecto, Oban, and Broadway, enabling users to observe these new components in dashboards.

_example\_applications/web\_app/lib/web\app · high confidence

Grafana Agent integration with configurable templates and multi-platform binary support

PromEx now includes a Grafana Agent integration that automatically downloads the Grafana Agent binary (version 0.42.0) for Linux, macOS (amd64/arm64), and FreeBSD, and renders a YAML configuration file using a customizable EEx template. Users can provide a custom template file via options, or rely on the default configuration, enabling seamless observability agent setup without manual binary management.

_lib/prom\_ex/grafana\agent · high confidence

Initial Grafana Agent integration with default configuration and process management

This change introduces the Grafana Agent integration, providing a default configuration template (default\_config.yml.eex) that sets up Prometheus scraping targets and remote write endpoints using configurable parameters like log level, scrape interval, and authentication credentials. It also includes a shell script (port\_wrapper.sh) designed to manage the agent process lifecycle, specifically handling background execution and cleanup when the parent process terminates.

_priv/grafana\agent · high confidence

Initial Phoenix web layer for the sample application

This change introduces the complete Phoenix web stack for the \web\_app\ example, including the main and internal endpoints, routers, and controllers. It adds a JSON API for managing users (create, read, update, delete, and level-up) and an events endpoint that exposes metrics from configured PromEx recorders. The web layer also includes Phoenix LiveView pages for the home and error states, a manual plug for custom routing, and telemetry configuration for Phoenix, database, and VM metrics.

_example\_applications/web\_app/lib/web\_app\web · high confidence

Initial configuration for the example Phoenix web application

This change introduces the configuration files (config.exs, dev.exs, prod.exs, test.exs) for the example Phoenix web application. It sets up the application to use multiple Ecto repositories (WebApp.Repo and WebApp.Repo2), configures Oban for background job processing with specific queues and plugins, and defines two Phoenix endpoints: a main endpoint and an internal endpoint for metrics. The configuration also includes settings for PromEx metrics collection with a standalone HTTP server, database connection details for development and test environments, and standard Phoenix/Logger settings for each environment.

_example\_applications/web\app/config · high confidence

Initial implementation of Grafana client connection and dashboard validation

Added the foundational components for the Grafana client, including a connection struct that supports both Basic and Bearer token authentication, and a dashboard checker module to validate dashboard structure and style requirements.

_lib/prom\_ex/grafana\client · high confidence

Initial project scaffolding and configuration

The repository has been initialized with essential project configuration files, including a Credo linter setup (.credo.exs), a Doctor documentation coverage configuration (.doctor.exs), and a Mix formatter configuration (.formatter.exs) that enforces a 120-character line length and imports dependencies for Plug, Phoenix, and Phoenix Live View. Additionally, the project now includes a MIT LICENSE, a CHANGELOG.md following the Keep a Changelog format, a .gitignore file, and a comprehensive README.md detailing installation, setup, and usage for the PromEx metrics library.

(repo-wide) · high confidence

Initial scaffold for the WebApp example application

This change introduces the foundational structure for a new Phoenix-based example application named WebApp. It includes the core Elixir modules for the application context and web interface, setting up the necessary imports and macros for controllers, views, LiveViews, and channels. On the frontend, it provides a complete asset pipeline configuration using Webpack, Babel, and SCSS, along with default styling based on Milligram CSS and the JavaScript entry point required to initialize Phoenix LiveView with NProgress loading indicators.

_example\_applications/web\_app/assets, example\_applications/web\app/lib · high confidence

New Apache Bench stress testing and plotting scripts

Added a suite of bash helper scripts in the benchmarks directory to automate performance testing using Apache Bench (ab) and visualize results with gnuplot. The new tools include ab-graph.sh for running single tests and generating plots, ab-graph\_merge.sh for combining multiple test results into comparative graphs, and ab-graph\_scale.sh for scaling tests across varying concurrency levels. This allows users to easily capture, store, and graph benchmark metrics such as response times and request rates.

benchmarks · high confidence

New Mix tasks for dashboard management and configuration generation

Added new CLI tasks to streamline PromEx setup and dashboard operations: \prom\_ex.gen.config\ generates a configuration module with instructions for supervision trees and plugins; \prom\_ex.dashboard.export\ renders dashboards to STDOUT or a file, supporting custom assigns and module-specific dashboard data; \prom\_ex.dashboard.publish\ uploads dashboards to Grafana via a dedicated client process; and \prom\_ex.dashboard.lint\ provides a placeholder for future dashboard validation. These tasks allow developers to generate, validate, export, and publish Grafana dashboards directly from the command line without starting the full application.

lib/mix · high confidence

New built-in plugins for Absinthe, Broadway, Ecto, Oban, and Phoenix LiveView

PromEx now ships with a comprehensive set of built-in plugins to automatically capture telemetry metrics for popular Elixir libraries. This release adds dedicated plugins for Absinthe (GraphQL execution and subscription timings), Broadway (message processing and batch metrics), Ecto (query execution, idle time, and repo initialization), Oban (job lifecycle, queue polling, and circuit breaker events), and Phoenix LiveView (mount and event handling durations). Additionally, the existing Phoenix plugin has been updated to support multiple endpoints and routers, while the Application and BEAM plugins provide deeper insights into system uptime, dependency versions, and VM internals like garbage collection and scheduler stats.

_lib/prom\ex/plugins · high confidence

New example web application with Docker and stress testing

Added a new Phoenix-based example application located in example\_applications/web\_app, including a Docker Compose configuration to run two application instances alongside shared Prometheus, Grafana, and Postgres services. The entry also includes a Finch-based stress test script to simulate load against the application endpoints, along with standard Elixir project scaffolding files like .formatter.exs and .gitignore.

_example\_applications/web\app · high confidence

New metric type structs for event, manual, and polling sources

PromEx now includes dedicated structs for defining event-based, manually triggered, and polling-based metrics. The new \PromEx.MetricTypes.Event\ module supports automatic bucket generation when the Peep storage adapter is configured. The \PromEx.MetricTypes.Manual\ module allows users to specify an MFA for emitting telemetry events. The \PromEx.MetricTypes.Polling\ module introduces a \detach\_on\_error\ option (defaulting to true) that, when disabled, wraps the polling MFA in a safe runner to prevent the polling job from stopping after an error, logging the error instead.

_lib/prom\_ex/metric\types · high confidence

Optional standalone metrics HTTP server with authentication support

PromEx now includes an optional standalone HTTP server for exposing metrics, implemented as a Plug that serves metrics at a configurable path (defaulting to /metrics). This server is only available if the :plug and :plug\_cowboy dependencies are present. It supports three authentication strategies via the :auth\_strategy option: :none (public access), :bearer (validates a Bearer token in the Authorization header), and :basic (validates Basic auth credentials). If the PromEx module is not initialized, the server returns a 503 Service Unavailable response; otherwise, it returns the metrics with a 200 OK response. Unauthorized requests return 401 Unauthorized.

_lib/prom\_ex/metrics\server · high confidence

PromEx 1.0 initial release with core metrics, Grafana integration, and standalone server

PromEx is now available as a stable library for collecting and exporting telemetry metrics in Elixir applications. This release introduces a plugin-based architecture for defining event, polling, and manual metrics, along with a configurable standalone HTTP metrics server (exposed via a Plug or Cowboy) and automatic dashboard upload to Grafana. It includes built-in support for running the Grafana Agent binary to push metrics via remote\_write, configurable ETS buffer flushing to prevent memory leaks, and lifecycle annotations in Grafana. The library also provides utilities for generating histogram buckets and rendering EEx-based dashboard templates.

_lib/prom\ex · high confidence

Behavioural changes

Built-in Grafana dashboards converted to EEx templates

The static JSON files for the built-in Grafana dashboards (Absinthe, Application, BEAM, Broadway, Ecto, Oban, Phoenix, Phoenix LiveView, Plug Cowboy, and Plug Router) have been replaced with EEx templates. This change allows the dashboard definitions to dynamically inject configuration variables—such as the OTP application name, datasource ID, and metric prefixes—directly into the JSON structure, ensuring that the dashboards automatically adapt to the user's specific application configuration without manual editing.

priv · high confidence

PromEx core module rewritten to support plugin-based architecture and configurable storage

The \PromEx\ module has been completely refactored from a simple utility into a comprehensive plugin-based library. Users must now define a module using \PromEx\ with an \:otp\_app\ configuration to leverage the new behavior. This change introduces a pluggable architecture where metrics collection is delegated to specific plugins (such as Beam, Phoenix, Ecto, and others listed in the documentation) and supports configurable storage adapters, defaulting to \TelemetryMetricsPrometheus.Core\ but allowing \Peep\. The module now provides callbacks for defining plugins and dashboards, manages a supervision tree for metrics collection and Grafana integration, and exposes a \get\_metrics/1\ function for scraping.

lib · high confidence

Test coverage

Added comprehensive test coverage for PromEx core components; Added test coverage for PromEx plugins; Added test fixtures for Broadway, Ecto, Oban, and Phoenix telemetry events; Added test support utilities and mock applications; Added tests for Grafana Agent configuration rendering and binary downloading; Added tests for Grafana client connection struct building; Added tests for PromEx mix tasks; Added tests for metrics server plug authentication and routing; Added unit tests for PromEx metric type builders; Expanded test coverage for PromEx configuration and metric collection; Initial test suite for the web application.

Dependencies

PromEx 1.12.0 release preparation and example app dependency updates

The main library manifest (mix.exs) is updated to version 1.12.0 with an Elixir requirement of \~\> 1.14, introducing a comprehensive dependency set that pins telemetry to \>= 1.0.0 and telemetry\_metrics to \~\> 1.0, while making Phoenix, Plug, Ecto, Oban, Absinthe, and Broadway optional dependencies with relaxed version constraints (e.g., Phoenix \>= 1.7.0). The example application (example\_applications/web\_app) is scaffolded with Phoenix 1.6.0, Phoenix Live View 0.16.0, Oban 2.9.0, and Broadway 1.0.2, alongside a new frontend asset setup using Webpack 5.94.0, Babel, and various security-patched npm packages like lodash and terser.

(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 57 → 56 (-0.7)
  • Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.

Lenses

  • Code Health 99 → 99 (+0.0)
  • Architecture 95 → 96 (+1.4)
  • Maturity 48 → 48 (+0.0)
  • Readiness 60 → 54 (-6.2)
  • Security 60 → 68 (+8.0)
  • Accessibility 63 → 63 (+0.0)

Resolved (2)

  • Duplicated block (9 lines × 2) (example_applications/web_app/lib/web_app_web/live/error_live.ex)
  • Medium CVE: EEF-[CVE redacted] (mix.lock)

New (3)

  • Duplicated block (10 lines × 2) (example_applications/web_app/lib/web_app_web/live/error_live.ex)
  • High CVE: [GHSA redacted] (mix.lock)
  • High CVE: [GHSA redacted] (example_applications/web_app/assets/package-lock.json)

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

Survey your own repository

akoutmos/prom_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 2ebcd0ed4a6f68f7cc802f99b6fbc3208650ddc3 — 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.