Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .dir-locals.el

This file was deleted.

40 changes: 30 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,47 @@ jobs:
name: Elixir ${{ matrix.elixir }} OTP ${{ matrix.otp }}
strategy:
matrix:
otp: ['27', '26', '25']
elixir: ['1.18.3', '1.17.3', '1.16.3']
otp: ['28', '27', '26']
elixir: ['1.18', '1.17', '1.16']
exclude:
# Unsupported
- elixir: '1.16.3'
- elixir: '1.17'
otp: '28'
- elixir: '1.16'
otp: '27'
runs-on: 'ubuntu-24.04'
- elixir: '1.16'
otp: '28'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- uses: actions/cache@v4
id: cache
with:
path: |
deps
_build
key: v1-${{runner.os}}-${{matrix.elixir}}-${{matrix.otp}}-${{hashFiles('**/mix.lock')}}
- run: mix deps.get
- run: mix deps.unlock --check-unused
- run: mix hex.audit
- run: mix compile --warnings-as-errors
- run: mix format --check-formatted
- run: mix coveralls
if: ${{ (matrix.otp == '27') && (matrix.elixir == '1.18.3' ) }}
- run: mix dialyzer
if: ${{ (matrix.otp == '27') && (matrix.elixir == '1.18.3' ) }}
- run: mix credo --strict --all
if: ${{ (matrix.otp == '27') && (matrix.elixir == '1.18.3' ) }}
if: ${{ (matrix.otp == '28') && (matrix.elixir == '1.18' ) }}
- run: mix dialyzer
if: ${{ (matrix.otp == '28') && (matrix.elixir == '1.18' ) }}
- run: mix docs
if: ${{ (matrix.otp == '27') && (matrix.elixir == '1.18.3' ) }}
if: ${{ (matrix.otp == '28') && (matrix.elixir == '1.18' ) }}
- run: MIX_ENV=test mix coveralls.json
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
if: ${{ (matrix.otp == '28') && (matrix.elixir == '1.18' ) }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: prometheus-erl/prometheus.ex
fail_ci_if_error: true
verbose: true
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Upload release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
release:
runs-on: ubuntu-latest
container:
image: elixir:1.18
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- run: chown --recursive --reference=/ .
- run: git config --global --add safe.directory '*'
- run: mix compile --warnings-as-errors
- run: mix format --check-formatted
- run: mix dialyzer
- run: mix credo --strict --all
- run: mix docs
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to hex.pm
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
run: mix hex.publish --yes
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Prometheus.ex
[![Build Status](https://github.com/deadtrickster/prometheus.ex/workflows/build/badge.svg)](https://github.com/deadtrickster/prometheus.ex/actions?query=branch%3Amaster)
[![Hex.pm](https://img.shields.io/hexpm/dt/prometheus_ex.svg?maxAge=2592000)](https://hex.pm/packages/prometheus_ex)
[![Coverage Status](https://coveralls.io/repos/github/deadtrickster/prometheus.ex/badge.svg?branch=master)](https://coveralls.io/github/deadtrickster/prometheus.ex?branch=master)
[![Hex.pm](https://img.shields.io/hexpm/v/prometheus_ex.svg?maxAge=2592000)](https://hex.pm/packages/prometheus_ex)
[![Documentation](https://img.shields.io/badge/documentation-on%20hexdocs-green.svg)](https://hexdocs.pm/prometheus_ex/)

Elixir [Prometheus.io](https://prometheus.io) client based on [Prometheus.erl](https://github.com/deadtrickster/prometheus.erl).
[![Hex.pm](https://img.shields.io/hexpm/v/prometheus_ex.svg?maxAge=2592000)](https://hex.pm/packages/prometheus_ex)
[![Hex.pm](https://img.shields.io/hexpm/dt/prometheus_ex.svg?maxAge=2592000)](https://hex.pm/packages/prometheus_ex)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/prometheus_ex/)
[![GitHub Actions](https://github.com/prometheus-erl/prometheus.ex/actions/workflows/main.yml/badge.svg)](https://github.com/prometheus-erl/prometheus.ex/actions/workflows/main.yml)
[![Coverage Status](https://coveralls.io/repos/github/prometheus-erl/prometheus.ex/badge.svg?branch=master)](https://coveralls.io/github/prometheus-erl/prometheus.ex?branch=master)
[![Codecov](https://codecov.io/github/prometheus-erl/prometheus.ex/graph/badge.svg?token=G9HB5UKNIY)](https://codecov.io/github/prometheus-erl/prometheus.ex)

Starting from v3.0.0 works with Elixir >=1.6 and Erlang >=20. For older versions, please use older tags.
Elixir [Prometheus.io](https://prometheus.io) client based on [Prometheus.erl](https://github.com/prometheus-erl/prometheus.erl).

Dashboard from [Monitoring Elixir apps in 2016: Prometheus and Grafana](https://aldusleaf.org/monitoring-elixir-apps-in-2016-prometheus-and-grafana) by [**@skosch**](https://github.com/skosch).

- IRC: #elixir-lang on Freenode;
- [Slack](https://elixir-slackin.herokuapp.com/): #prometheus channel - [Browser](https://elixir-lang.slack.com/messages/prometheus) or [App](slack://elixir-lang.slack.com/messages/prometheus).

## Example

```elixir
Expand Down Expand Up @@ -56,18 +53,18 @@ you don't have to call setup manually.
Please read how to [measure durations correctly with prometheus.ex](https://hexdocs.pm/prometheus_ex/time.html#content).

## Integrations / Collectors / Instrumenters
- [Ecto collector](https://github.com/deadtrickster/prometheus-ecto)
- [Ecto collector](https://github.com/prometheus-erl/prometheus-ecto)
- [Elli middleware](https://github.com/elli-lib/elli_prometheus)
- [Extatus - App to report metrics to Prometheus from Elixir GenServers](https://github.com/gmtprime/extatus)
- [Plugs Instrumenter/Exporter](https://github.com/deadtrickster/prometheus-plugs)
- [Plugs Instrumenter/Exporter](https://github.com/prometheus-erl/prometheus-plugs)
- [Fuse plugin](https://github.com/jlouis/fuse#fuse_stats_prometheus)
- [OS process info Collector](https://hex.pm/packages/prometheus_process_collector) (Linux-only)
- [Phoenix instrumenter](https://github.com/deadtrickster/prometheus-phoenix)
- [RabbitMQ Exporter](https://github.com/deadtrickster/prometheus_rabbitmq_exporter)
- [Phoenix instrumenter](https://github.com/prometheus-erl/prometheus-phoenix)
- [RabbitMQ Exporter](https://github.com/prometheus-erl/prometheus_rabbitmq_exporter)

## Dashboards

- [Beam Dashboards](https://github.com/deadtrickster/beam-dashboards).
- [Beam Dashboards](https://github.com/prometheus-erl/beam-dashboards).

## Installation

Expand Down
3 changes: 0 additions & 3 deletions bin/checks.sh

This file was deleted.

95 changes: 0 additions & 95 deletions bin/increment-version

This file was deleted.

18 changes: 0 additions & 18 deletions bin/pre-commit.sh

This file was deleted.

5 changes: 2 additions & 3 deletions lib/prometheus.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ defmodule Prometheus do
- [OS process info Collector](https://hex.pm/packages/prometheus_process_collector)
(Linux-only);
- [Phoenix Instrumenter](https://hex.pm/packages/prometheus_phoenix);
- [RabbitMQ Exporter](https://github.com/deadtrickster/prometheus_rabbitmq_exporter).
- [RabbitMQ Exporter](https://github.com/prometheus-erl/prometheus_rabbitmq_exporter).

## Erlang VM Collectors
- [Memory Collector](vm-memory-collector.html);
Expand All @@ -53,8 +53,7 @@ defmodule Prometheus do

### Standard Metrics & Registry

- `Prometheus.Metric.Counter` - counter metric, to track counts of events or running
totals;
- `Prometheus.Metric.Counter` - counter metric, to track counts of events or running totals;
- `Prometheus.Metric.Gauge` - gauge metric, to report instantaneous values;
- `Prometheus.Metric.Histogram` - histogram metric, to track distributions of events;
- `Prometheus.Metric.Summary` - summary metric, to track the size of events;
Expand Down
2 changes: 1 addition & 1 deletion lib/prometheus/collector.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule Prometheus.Collector do
- `deregister_cleanup(registry)` - called when collector unregistered by
`registry`. If collector is stateful you can put cleanup code here.

Example (simplified [`:prometheus_vm_memory_collector`](https://github.com/deadtrickster/prometheus.erl/blob/master/doc/prometheus_vm_memory_collector.md)):
Example (simplified [`:prometheus_vm_memory_collector`](https://github.com/prometheus-erl/prometheus.erl/blob/master/doc/prometheus_vm_memory_collector.md)):

```
iex(3)> defmodule Prometheus.VMMemoryCollector do
Expand Down
22 changes: 14 additions & 8 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
defmodule PrometheusEx.Mixfile do
use Mix.Project

@source_url "https://github.com/deadtrickster/prometheus.ex"
@version "4.0.0"
@source_url "https://github.com/prometheus-erl/prometheus.ex"
@version "5.0.0"

def project do
[
Expand All @@ -16,12 +16,18 @@ defmodule PrometheusEx.Mixfile do
name: "Prometheus.ex",
deps: deps(),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [coveralls: :test, "coveralls.html": :test],
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
docs: [
main: Prometheus,
source_ref: "v#{@version}",
source_url: @source_url,
extras: [
"pages/prometheus_and_grafana_setup.md",
"pages/Mnesia Collector.md",
"pages/VM Memory Collector.md",
"pages/VM Statistics Collector.md",
Expand All @@ -44,7 +50,7 @@ defmodule PrometheusEx.Mixfile do

defp package do
[
maintainers: ["Ilya Khaprov"],
maintainers: ["Ilya Khaprov", "Nelson Vides"],
licenses: ["MIT"],
links: %{
"GitHub" => @source_url,
Expand All @@ -60,14 +66,14 @@ defmodule PrometheusEx.Mixfile do

defp deps do
[
{:prometheus, "~> 5.0"},
{:prometheus, "~> 6.0"},

## test
{:credo, "~> 1.0", only: [:dev, :test]},
{:dialyxir, "~> 1.4", only: [:dev]},
{:earmark, "~> 1.3", only: [:dev]},
{:ex_doc, "~> 0.19", only: [:dev]},
{:excoveralls, "~> 0.10", only: [:test]}
{:earmark, "~> 1.4", only: [:dev]},
{:ex_doc, "~> 0.38", only: [:dev]},
{:excoveralls, "~> 0.18", only: [:test]}
]
end
end
Loading